Actually, I have:
function switch()
{
if(document.getElementById('mydivid').innerHTML == "Show +")
document.getElementById('mydivid').innerHTML = "Show -";
else
if(document.getElementById('mydivid').innerHTML == "Show -")
document.getElementById('mydivid').innerHTML = "Show +";
}
but I am looking to do this with jQuery. I have:
$(document).ready(function() {
$("#mydivid").click(function() {
// if #mydivid is "Show +" do: $("#mydivid").html("Show -");
// else if #mydiv is "Show -" do: $("#mydivid").html("Show +");
});
});
How can I use these ifs? Or can I use toggler with only one div element?
I think this should work.