Jump to content

Hyper Link In Option


Chikwado

Recommended Posts

How to make hyper link in option, I have try html code all the way but not successfull. The code are:

<html>
<body>
<script> function change() { if(document.getElementById("option1").selected==true) {window.open('http://www.google.com/' , 'target')};} </script><select onchange= "changelink()"><option id="option1">My Link</option></select></body></html> Then when I click the link it do not open google, Some one help. Edited by Chikwado
Link to comment
Share on other sites

You can use the selectedIndex property of the select element, not the option element, and the select element's options array to get the selected option. Look up how to get the selected option of a select element and you'll find examples.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...