JavaScript Reference/Javascript Properties/hash — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 08:21, 26 мая 2010
"hash" Example
<html>
<body>
<script language="JavaScript">
function function1() {
alert(document.getElementById("myLink").hash);
}
</script>
<a tabindex="2" id="myLink" href="test.htm#sty" target="_blank">
anchor element
</a>
<button onclick="function1();">Hash Value</button>
</body>
</html>
"hash" is applied to
+----------------+--------------------------------------------------------------+
| Applied_To |<a> <area> |
| |location |
+----------------+--------------------------------------------------------------+
"hash" Syntax and Note
Note:
Read and write property.
Specifies the hash part of URL (the part that follows a # sign).
Syntax:
document.getElementById("elementID").hash = value
document.all.elementID.hash = value // IE only
location.hash = value