[Javascript] <option> and onSelect

Innerlab innerlab at hotmail.com
Fri Mar 19 15:53:29 CST 2004


I can't make the following work. The idea is to change the document.location
to the url in the
"value" paramater of an <option> tag when the latter is selected.
The whole thing must be written on the fly with javascript as shown below

document.write("<option value='http://www.mysite.com'
onSelect='document.location=this.value'>Site One</option>")

Thanks in advance.






More information about the Javascript mailing list