JQuery - Got to URL on Option Select


/ Published in: jQuery
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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. });

URL: http://www.mycollegesandcareers.com

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.