A simple hide on click code.
Code:
function dispHandle(obj) {
if (obj.style.display == 'none') {
obj.style.display = '';
} else {
obj.style.display = 'none';
} }
Code:
<p id="hide">Hello</p>
<a onclick="dispHandle(hide)">Hide/show text</a>
Here's what I need help with. This code only works if the object you want to control has an ID attribute. I need it to work for something that only has a CLASS attribute. The main reason is that I need a button to control a dozen different parts, simultaneously. Finding the file for each one of the parts and editing the code to add a ID attribute would take a lot of time, and would be very easy to miss several of the objects. There are over 43 files that would need this done to it. But they all already have the same CLASS attribute, so it would be easier to modify this one instance of code that it would be to modify 40+.