title: Why isn't my JavaScript working in JSFiddle?
body: <p>I can't find out what is the problem with this <a href="http://jsfiddle.net/Yazpj/" rel="noreferrer">JSFiddle</a>.</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;input type="button" value="test" onclick="test()"&gt;
  </code></pre>
  
  <p>JavaScript:</p>
  
  <pre><code>function test(){alert("test");}
  </code></pre>
  
  <p>And when I click on button - nothing happened. The console says "test not defined"</p>
  
  <p>I've read the JSFiddle documentation - there it says that JS code is added to <code>&lt;head&gt;</code> and HTML code is added to <code>&lt;body&gt;</code> (so this JS code is earlier than html and should work).</p>