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
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
<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title></title> <script> //创建select元素 function createSelect(){ var ele = document.createElement('select'); for(var i=0;i<10;i++){ var op = new Optio