w3schools show and hide code example
Example 1: jquery show hide
$("#hide").click(function(){
$("p").hide();
});
$("#show").click(function(){
$("p").show();
});
Example 2: hide automatically show and hide javascript
function toggleClock() {
var myClock = document.getElementById('clock');
var displaySetting = myClock.style.display;
var clockButton = document.getElementById('clockButton');
if (displaySetting == 'block') {
myClock.style.display = 'none';
clockButton.innerHTML = 'Show clock';
}
else {
myClock.style.display = 'block';
clockButton.innerHTML = 'Hide clock';
}
}