Location.hash : Location : Location JAVASCRIPT TUTORIALS

JAVASCRIPT TUTORIALS » Location » Location »



The hash property refers to the anchor portion of the URL, including the hash symbol (#).

If the URL contains a pound sign (#), this returns the content after it (for example, http://www.navioo.com/index#section1 has a hash equal to "#section1").

    <title> Using the hash property of the Location object</title>
    <script language="JavaScript">
    function show(){
    <form name="form1">
    Click the button to get the current location.hash
    value of the following address:
    <input type="button" name="getLoc" value="Get hash value" onClick='show()'>

HTML code for linking to this page:

Follow Navioo On Twitter


 Navioo Location
» Location