jQuery get selected option value (not the text, but the attribute 'value')

后端 未结 14 2088
长情又很酷
长情又很酷 2020-11-29 18:13

Okay, I have this code:


   
   
   

... you can get the id this way:

$('#list-name option:selected').attr('id');

Or you can use value instead, and get it the easy way...


                        
    
提交评论

提交回复
热议问题