Posted By

smoothdzion on 03/23/11


Tagged

select option jquery


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

smoothdzion
jillella


JQuery - Got to URL on Option Select


 / Published in: jQuery
 

URL: http://www.mycollegesandcareers.com

Use this to go to a URL when selecting an option.

  1. $(function(){
  2. // bind change event to select
  3. $('#select_id').bind('change', function () {
  4. var url = $(this).val(); // get selected option value
  5. if (url) { // require url to have value
  6. window.location = url; // open url
  7. }
  8. return false;
  9. });
  10. });

Report this snippet  

You need to login to post a comment.