title: button toggle event onkeyup from body
body: <p>I need help with this function. Clicking a button, the onkeyup event present in the body tag must be deactivated, and then pressing it again must reactivate</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;body onkeyup="NoPreview()"&gt;
  ...
  &lt;/body&gt;
  </code></pre>
  
  <pre><code>function NoPreview() {
  var preview = true;
  if (preview == true) {
  document.body.onkeyup = null;
  preview = false;
  } else {
  return true; }
  }
  </code></pre>
  
  <p>the function was deactivated, but clicking again on the button, does not reactivate.</p>