Get hash value from URL using Jquery

By | September 2, 2017

Get hash value from URL using Jquery

We can get the hash value from a URL using the window.location.hash method in jquery.

For example, let’s try to get the hash value from the url below.

www.example.com/index.php#hashvalue

var hash = window.location.hash;
if(hash){
alert(hash);
// this will alert the hasvalue
}

🔥1

Leave a Reply