Set select option 'selected', by value

后端 未结 28 2801
攒了一身酷
攒了一身酷 2020-11-22 10:40

I have a select field with some options in it. Now I need to select one of those options with jQuery. But how can I do that when I only know the

28条回答
  •  天涯浪人
    2020-11-22 11:45

    This Works well

    jQuery('.id_100').change(function(){ 
            var value = jQuery('.id_100').val(); //it gets you the value of selected option 
            console.log(value); // you can see your sected values in console, Eg 1,2,3
        });
    

提交回复
热议问题