Hey guys,
I am trying to write some code so that when you click on the <h3>, it finds the nextSibling (which is always a div) and then shows or hides it based on whether it’s already shown or hidden. It works great in IE but it won’t work in Firefox
The HTML code looks a little like this:
[code=html]<h3>Header</h3>
<div>
<p>Content</p>
<p>More Content</p>
</div>
There are two DOM functions – the first one finds the div tags and sets them accordingly with an onclick = function() embedded. The second one looks like this:
[code=html]function createHideShow(thislist) {
var pArea = thislist.nextSibling;
// Displays the <p> and <img> tags if they are hidden
if (pArea.style.display == “none”) {
pArea.style.display = “block”;
}
else {
pArea.style.display = “none”;
}
}
Any ideas?