IFrame名プロパティ
例
iframeの名前を取得します。
var x = document.getElementById("myFrame").name;
定義と使用法
nameプロパティは、iframe要素のname属性の値を設定または返します。
name属性は、iframeの名前を指定し、JavaScriptで要素を参照するために、または<a>または<form>要素のtarget属性の値として、または<input>のformtarget属性として使用できます。または<button>要素。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
name | Yes | Yes | Yes | Yes | Yes |
構文
nameプロパティを返します。
iframeObject.name
nameプロパティを設定します。
iframeObject.name = name
プロパティ値
Value | Description |
---|---|
name | The name of the iframe |
技術的な詳細
戻り値: | iframeの名前を表す文字列 |
---|
その他の例
例
iframeの名前を変更します。
document.getElementById("myFrame").name = "newIframeName";
関連ページ
HTMLリファレンス:HTML <iframe> name属性
❮IFrameオブジェクト