title: Javascript "onClick" event doesn't work
body: <p>I have this line in my php file:</p>
  
  <pre><code>echo "&lt;input type='button' id='showButton' value='show'  onclick='showOld()'&gt;";
  </code></pre>
  
  <p>The button is displayed but when it is clicked, nothing happens.</p>
  
  <p>The function is located in an external JS file.
  this is function declaration:</p>
  
  <p>Other "onclick" events and JS functions in the page are working.</p>
  
  <pre><code>    function showOld()
      {
      alert("njkh");
      var table = document.getElementById("showExp");
      var button = document.getElementById("showButton");
      if (table.style.display == "none")
      {
          table.style.display = "inline";
          button.value = "הסתר ניסויים ישנים";
      }
      else if (table.style.display == "inline")
      {
          table.style.display = "none";
          button.value = "הצג את כל הניסויים";
      }       
      }
  </code></pre>
  
  <p><strong>console says "ReferenceError: showOld is not defined"</strong></p>