エリアパス名プロパティ
例
画像マップの特定の領域のURLのパス名を返します。
var x =
document.getElementById("venus").pathname;
定義と使用法
pathnameプロパティは、href属性値のpathname部分を設定または返します。
href属性は、エリア内のリンクの宛先を指定します。
注:上記の例では、IE9以前のバージョンは「jsref / venus.htm」を返しますが、IE 10以降、Firefox、Opera、Chrome、Safariは「/jsref/venus.htm」を返します。
ブラウザのサポート
Property | |||||
---|---|---|---|---|---|
pathname | Yes | Yes | Yes | Yes | Yes |
構文
pathnameプロパティを返します。
areaObject.pathname
pathnameプロパティを設定します。
areaObject.pathname = path
プロパティ値
Value | Description |
---|---|
path | Specifies the pathname of a URL |
技術的な詳細
戻り値: | URLのパス名を表す文字列 |
---|
その他の例
例
画像マップの特定の領域のURLのパス名を変更します。
document.getElementById("venus").pathname = "somenewpathname";
❮エリアオブジェクト