title: Making a button invisible by clicking another button in HTML
body: <p>How can I make a button invisible by clicking another button in HTML?<br>
  I have written like below, but it doesn't work.</p>
  
  <pre><code>&lt;input type="button" onclick="demoShow();" value="edit" /&gt;
  &lt;script type="text/javascript"&gt; 
      function demoShow()
      { document.getElementsByName('p2').style.visibility="hidden"; }
  &lt;/script&gt;
  &lt;input id="p2" type="submit" value="submit" name="submit" /&gt;
  </code></pre>