I have 4 div’s on the page with unique ID’s. Example external link:
www.website.com/page.html#one.
I need the display (set to none) to change to block. I’m at a bit of a loss (my JavaScript isn’t very strong). Any ideas? Below is the code I’m using to parce the url, and the div id’s are literally just one, two, three, and four.
$(document).ready(function()
{
var hashVal = window.location.hash.split("#")[1];
$("#" + hashVal).style.display = 'block';
});
There’s no need to split the hash tag by the hash mark if you’re going to use it as a selector. (see these docs)
And, for jQuery, you’re looking for the
cssmethod i believe: