Am using following script to show/hide div on button click
function showHide(divID){
if (document.getElementById(divID).style.display == "none") {
$('#'+divID).fadeIn(3000);
} else {
$('#'+divID).fadeOut(3000);
}
}
this is my HTML:
<button onClick="showHide('hideDiv',this.id)" type="button">English</button>
<button onClick="showHide('hideDiv',this.id)" type="button">Math</button>
<button onClick="showHide('hideDiv',this.id)" type="button">French</button>
and using a single div to display the content of the button on click
<div id="hideDiv" style="display:none;">
<p>A painting workshop in the early Renaissance probably resembled</p>
</div>
When I click math after English, the content will hide, after one more click, the content is displayed again. But, I want to show the content when user click any button, I want to hide the "Hide" property here, so that user will get to see the content whichever button he clicks.
here is the fiddle link http://jsfiddle.net/ytyAd/