Error function not defined in javascript
<p>I have a sample code:</p>

<pre><code>&lt;input width="50" type="text" value="" name="application_id" id="text_input"&gt;
&lt;a href="#" onclick="addSelect('1', 'Test Name');" title="Click to add this item"&gt;Test Name&lt;/a&gt;
</code></pre>

<p>And javascript</p>

<pre><code>function addSelect(id, title) {
    document.getElementById('text_input').value = title;
}
</code></pre>

<p>When I run code, result error is <code>addSelect is not defined</code> ? <a href="http://jsfiddle.net/TmLut/" rel="nofollow">demo here</a> , how to fit it ?</p>
