On 07/08/2010 12:57 PM, Angel Herráez wrote:
> Piero, if you just want to select, just need to refer to the list and
> its element:
>
> assuming you have an ID, like
> <select id="mySelect">
>
> then to select the 4th item:
> document.getElementById("mySelect").selectedIndex=3
>
> It can also be done using the NAME of the select
>
I forgot to point out in my reply why I wouldn't recommend using the
index number directly.
If you use the index number directly for selection then you have to
recode things if the list changes (e.g. insertion, removal, resorting).
By using the value instead you can avoid this (if you have set up the
item values properly).
Regards,
Rolf
------------------------------------------------------------------------------
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
_______________________________________________
Jmol-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jmol-users