title: How to update the onclick event of the element using pure javascript?
body: <p>how to change <strong>onclick="javascript:func-x()"</strong>   </p>
  
  <pre><code>&lt;input type="button" onclick="javascript:func-x()" value="MENU" id="btn"&gt;
  </code></pre>
  
  <p>to <strong>onclick="javascript:func-y()"</strong> with same id on <strong>javascript?</strong></p>
  
  <pre><code>&lt;input type="button" onclick="javascript:func-y()" value="MENU" id="btn"&gt;
  </code></pre>
  
  <p>I've tried:</p>
  
  <pre><code>var c = document.getElementById('btn'); //input#btn
  // ...
  </code></pre>
  
  <p>But I don't know what to continue...</p>