[Solved] simple JavaScript code to show and hide data


To toggle the div this is the code using Javascript.

document.getElementById("hide").onclick=function(){
  document.getElementById("data").style.display="none";
  }
document.getElementById("show").onclick=function(){
  document.getElementById("data").style.display="block";
  }
<div id="data"> this is some data </div>
<input type="button" id="show" value="show data">
<input type="button" id="hide" value="hide data">

solved simple JavaScript code to show and hide data