about moving items in selectbox
<p>I am trying to moving the items in a select box by using buttons.. for this i used swapNode().
But it is working only in IE. in chrome not working how to make it to work in chrome
Here is my code</p>

<pre><code> &lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
&lt;html&gt;
 &lt;head&gt;
  &lt;title&gt;Moving the options up and down in Multiple select box &lt;/title&gt;
 &lt;script type="text/javascript"&gt;
 function move(id)
 {

if (id=='up')
{
    var len=    document.f1.selectbox1.options.length;
    if (document.f1.selectbox1[0].selected)
    {
        alert("This is the first record");
        return false;
    }
    var up_id=document.f1.selectbox1.selectedIndex;
    document.f1.selectbox1[up_id].swapNode(document.f1.selectbox1[up_id-1]);
}
if (id=='down')
{
 var len=document.f1.selectbox1.options.length;
    if (document.f1.selectbox1[len-1].selected)
    {
        alert("This is last record");
        return false;
    }
    var down_id=document.f1.selectbox1.selectedIndex;
    document.f1.selectbox1[down_id].swapNode(document.f1.selectbox1[down_id+1]);
}
if (id=='top')
{
    var len=document.f1.selectbox1.options.length;
    if (document.f1.selectbox1[0].selected)
    {
        alert("This is the first record");
        return false;
    }
    var top_id=document.f1.selectbox1.selectedIndex
    for (var j=top_id;j&gt;0 ;j-- )
    {   
            document.f1.selectbox1[j].swapNode(document.f1.selectbox1[j-1]);
    }
}
if (id=='bottom')
{
    var len=document.f1.selectbox1.options.length;;
    if(document.f1.selectbox1[len-1].selected)
        {
            alert("This is last record");
            return false;
        }
        var bot_id=document.f1.selectbox1.selectedIndex
        for (var k=bot_id; k&lt;len-1;k++)
        {
                document.f1.selectbox1[k].swapNode(document.f1.selectbox1[k+1]);

        }
}
 }
 &lt;/script&gt;
 &lt;/head&gt;
 &lt;body&gt;
  &lt;form name="f1"&gt;
&lt;select multiple size="20" style="width:30%" name="selectbox1" id="select_box"&gt;
&lt;option id="1"&gt;First item&lt;/option&gt;
&lt;option id="2"&gt;Second item&lt;/option&gt;
&lt;option id="3"&gt;Third item&lt;/option&gt;
&lt;option id="4"&gt;Fourth item&lt;/option&gt;
&lt;option id="4"&gt;Fifth item&lt;/option&gt;
&lt;option id="4"&gt;Sixth item&lt;/option&gt;
&lt;option id="4"&gt;Seventh item&lt;/option&gt;
&lt;option id="4"&gt;Eighth item&lt;/option&gt;
&lt;option id="4"&gt;Ninth item&lt;/option&gt;
&lt;option id="4"&gt;Tenth item&lt;/option&gt;
&lt;/select&gt;&lt;br&gt;
&lt;input type="button" value="Up" onClick="move('up')"&gt;
&lt;input type="button" value="Down" onClick="move('down')"&gt;
&lt;input type="button" value="Top" onClick="move('top')"&gt;
&lt;input type="button" value="Bottom" onClick="move('bottom')"&gt;
  &lt;/form&gt;
 &lt;/body&gt;
&lt;/html&gt;
</code></pre>
