<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<select id="select">
<option value ="A">111</option>
<option value ="B">222</option>
<option value ="C">333</option>
<option value ="D">444</option>
</select>
</body>
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script type="text/javascript">
$("#select").on("change",function(){
console.log($("#select option:selected").html())
console.log($("#select option:selected").val())
})
</script>
</html>
选择器 select option:selected
最新推荐文章于 2022-12-28 09:33:41 发布