May 18, 2015

jQuery select box onchange window.location

Give the same name of select box ID and jQuery ID.

<select id="redirect" onchange="window.location = jQuery('#redirect option:selected').val();">
 <option value="http://www.google.com">Great Site</option>
 <option value="http://www.yahoo.com">Better Site</option>
</select>

Enjoy!

1 comment:

  1. Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here.
    Kindly keep blogging. If anyone wants to become a Front end developer learn from javascript and jquery training in chennai .
    or learn thru Javascript Training in Chennai.
    Nowadays JavaScript has tons of job opportunities on various vertical industry. javascript and jquery training in chennai

    ReplyDelete

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...