JavaScript Conundrum
<p>I want to move a JavaScript function up to the <code>&lt;script&gt;</code> tag from a input tag and it's not working.</p>

<p>This works:</p>

<pre><code>&lt;input type="text" name="aaa" id="aaa" onkeyup="javascript:this.value=
  this.value.substring(0,1).toUpperCase()+
    this.value.substring(1,this.value.length);
  if (this.value=='') 
    document.getElementById('aaaLabel').innerHTML='AAA';"
/&gt;
</code></pre>

<p>This doesn't:</p>

<pre><code>&lt;script type="text/javascript"&gt;
  function FieldOnKeyUp() {
    this.value=this.value.substring(0,1).toUpperCase()+
      this.value.substring(1,this.value.length);
    if (this.value=='') 
      document.getElementById('aaaLabel').innerHTML='AAA'; 
  }
&lt;/script&gt;
</code></pre>

<hr>

<pre><code>&lt;input type="text" name="aaa" id="aaa" onkeyup="FieldOnKeyUp()"&gt;
</code></pre>

<p>What's the difference?</p>
