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

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

Okay, I have this code:


  
  
  
  

Old answer:

Edit: As many pointed out, this does not returns the selected option value.

~~Use .val to get the value of the selected option. See below,

$('select[name=selector]').val()~~

提交回复
热议问题