JavaScript Reference/Javascript Properties/pathname — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:21, 26 мая 2010
"pathname" Example
<html>
<body>
<script language="JavaScript">
function function1() {
alert(document.getElementById("myLink").pathname);
}
</script>
<a id="myLink" href="http://www.wbex.ru" target="_blank">wbex.ru home page</a>
<input type="Button" id="myB" value="File and path to the page" onClick="function1();">
</body>
</html>
"pathname" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<a> <area> |
| |location |
+----------------+--------------------------------------------------------------+
"pathname" Syntax and Note
Note:
Read and write property.
Sets the object path name.
Syntax:
document.getElementById("elementID").pathName = value
document.all.elementID.pathName = value // IE only
location.pathName