jquery获得option的值和对option进行操作

时间:2020-12-03 10:47:43
【文件属性】:
文件名称:jquery获得option的值和对option进行操作
文件大小:36KB
文件格式:PDF
更新时间:2020-12-03 10:47:43
io jq jquery jQuery获取Select元素,并选择的Text和Value: 代码如下: $(“#select_id”).change(function(){//code…}); //为Select添加事件,当选择其中一项时触发 var checkText=$(“#select_id”).find(“option:selected”).text(); //获取Select选择的Text var checkValue=$(“#select_id”).val(); //获取Select选择的Value var checkIndex=$(“#select_id “).get(0).selectedIndex;

网友评论