Redirect automatically when selecting an item from a select drop-down list

后端 未结 5 1301
予麋鹿
予麋鹿 2020-11-29 05:26

This page does it the way I want it to: http://www.web-source.net/javascript_redirect_box.htm

But I want to find a better way using jQuery, can anyone point me to a

5条回答
  •  鱼传尺愫
    2020-11-29 06:02

    I haven't tested this but I think it's equivalent to the sample on the page you referenced.

    $(document).ready( function() {
       $('#select').change( function() {
          location.href = $(this).val();
       });
    });
    
    
    

提交回复
热议问题