show hide toggle javascript code example
Example 1: jquery toggle show hide
$( "#clickme" ).click(function() {
$( "#book" ).toggle( "slow", function() {
// Animation complete.
});
});
Example 2: toggle element javascript
document.querySelector("#test").hidden = true;
document.querySelector("#test").hidden = false;