www.fgks.org   »   [go: up one dir, main page]

Skip Navigation Links
  

Internet Explorer Developer Center

Click to Rate and Give Feedback
Properties
 hash Property
hash Property

Sets or retrieves the subsection of the href property that follows the number sign (#).

Syntax

HTMLN/A
Scripting[ sHash = ] object.hash

Possible Values

sHashString that specifies or receives the part of the URL following the number sign (#).

The property is read/write. The property has no default value.

Expressions can be used in place of the preceding value(s), as of Microsoft® Internet Explorer 5. For more information, see About Dynamic Properties.

Remarks

If there is no number sign, this property returns an empty string.

This property is useful for moving to a bookmark within a document. Assigning an invalid value does not cause an error.

Example

This example function returns true if the current document URL has a hash value, or false if the document URL does not.

function hasHash()
{
    if (document.location.hash == "")
        return false;
    return true;
}

Standards Information

There is no public standard that applies to this property.

Applies To

A, AREA, location
Tags What's this?: Add a tag
Community Content
 
Add Community Content
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker
DCSIMG