I am having a challenge. I have 2 divs, one set to display:none; in the css when the page loads I have two corresponding links. When the user clicks on
divs
display:none;
Here an example:
$(function () { $(".div1, .div2").hide(); $(".link1, .link2").bind("click", function () { $(".div1, .div2").hide(); if ($(this).attr("class") == "link1") { $(".div1").show(); } else { $(".div2").show(); } }); });
And here is the Demo