Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

new window from select onChange

This works but I require it to open the link in a new window:

<select onChange="window.location=this.value">
<option value ="">select</option> 
<option value="http://www.google.com">google</option>
</select>

(I note this has been shown using a button and form but I require it to happen by selecting only)

like image 656
gungu Avatar asked Oct 24 '25 05:10

gungu


1 Answers

Have you tried the window.open?

<select onChange="window.open(this.value)">
<option value ="">select</option> 
<option value="http://www.google.com">google</option>
</select>

https://jsfiddle.net/m9ts7tnj/

like image 56
hack3rfx Avatar answered Oct 26 '25 19:10

hack3rfx



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!