Here is the code I've created:
<a href="#" id="home" class="showLink" onclick="showHide('example');return false;">
<li class="buttons">home</li>
</a>
<a href="#" id="user" class="showLink" onclick="showHide('example2');return false;">
<li class="buttons">users</li>
</a>
This is the JavaScript code:
function showHide(shID) {
if (document.getElementById(shID)) {
if ((document.getElementById(shID).style.display == 'none')||(document.getElementById(shID).style.display == '')) {
document.getElementById(shID).style.display = 'block';
}
else {
document.getElementById(shID).style.display = 'none';
}
}
}
I am looking to have the 'example' appear and 'example2' hidden when clicking on 'home', and vice versa. Is this achievable?