I\'m trying to get the hash value after a link was clicked. Any ideas?
e.g.
The Link
index.html#needThis
This is my result:
Just use var hash = window.location.hash.
var hash = window.location.hash
It returns everything after #
Or if you've got a variable which contains an url:
$(this).attr('href').substring($(this).attr('href').indexOf('#'))