jquery选择select标签选中的option的title值

比如知道select的ID为testid,要获得选中的option的title值,那么可以用下面代码。

$("#testid option:selected").attr("title")

也可以用:

$("#testid").find("option:selected").attr("title")

如果绑定事件的那么用:

$(this).find("option:selected").attr("title")

猜你喜欢

转载自blog.csdn.net/sysdzw/article/details/52149078