Code executes when typed into console but not in script : <p>I have a javascript project i am running,and i have finished the first phase.The second phase requires for me to start by assigning a <code>variable</code> to a <code>dom</code> object.</p>

<p>I assigned the <code>variable</code> and it worked.Then i updated the <code>code</code> into my project <code>script</code>.Now,the problem is that whenever i run the <code>script</code> the <code>script</code> will execute but,the <code>variable</code> i assigned and updated into my <code>script</code> won't assign and the <code>code</code> line won't run.</p>

<pre><code>    var element = document.getElementById('inputElement');
</code></pre>

<p>Every time i run that line in the <code>console</code> maybe by copy/paste or typing it personally it works but,the <code>code</code> won't execute when it is in a script.</p>
