function show() {
if(document.getElementById('intake').style.display=='none') {
document.getElementById('intake').style.display='block';
}
false;
}
function hide() {
if(document.getElementById('intake').style.display=='block') {
document.getElementById('intake').style.display='none';
}
false;
}
<div id="opener"><a href="#1" name="1" onmouseover="show();" onclick="show();" onmouseout="hide();" >click here</a></div>
<div id="intake" style="display:none;">Text
<div id="upbutton"><a onmouseout="hide();">click here</a></div>
</div>
<div id="opener"><a href="#1" name="2" onmouseover="show();" onclick="show();" onmouseout="hide();" >click here</a></div>
<div id="intake" style="display:none;">text
<div id="upbutton"><a onmouseout="hide();">click here</a></div>
</div>
I wrote two functions and I need them to grab the ID of what ever the user clicked. and display that information. I don't want to have to write a different function for each ID as I have quite a few. Can someone please point me in the right direction.
function show() {
if(document.getElementById('this is where all of the divs would go i presume').style.display=='none') {
document.getElementById('this is where all of the divs would go i presume').style.display='block';
}
false;
}
I just figured I would add the whole thing to alleviate any confusion.