javascript - name or id of element
<p>Is <code>this.form.sel2</code> similar to <code>document.getElementById('sel2')</code>?</p>

<p>My select tag is as follows: </p>

<pre><code>&lt;select size=5 id="sub_player_ids" name="sub[player_ids][]"&gt;
</code></pre>

<p>And when I am putting the name of the tag, i.e, <code>sub[player_ids][]</code> in my javascript code, am getting a syntax error. 
I am trying to find a workaround so that instead of using the name of the element, i want to use the id.</p>

<p>However using <code>document.getElementById('sub_player_ids')</code> is not working.</p>

<p>Thanks for any suggestion provided.</p>

<p>Please see my javascript code below:</p>

<pre><code>      &lt;input type="button" value="--&amp;gt;"
       onclick="moveOptions(this.form.sel1, this.form.sel2);" /&gt;&lt;br /&gt;
      &lt;input type="button" value="&amp;lt;--"
       onclick="moveOptions(this.form.sel2, this.form.sel1);" /&gt;
</code></pre>
