hash = hash.replace( /^#/, '' );
var node = $( '#' + hash );
if ( node.length ) {
node.attr( 'id', '' );
}
document.location.hash = hash;
if ( node.length ) {
node.attr( 'id', hash );
}
Im having trouble with the code above, which I grabbed from this article: Modifying document.location.hash without page scrolling, trying to temporarily replace the id of a div while I change the location.hash to said id. hash comes up with this error in the console: Uncaught ReferenceError: hash is not defined. I'm new to JS and need a little guidance! thanks :)