语法解释:1. $("#select_id").change(function(){//code...}); //为Select添加事件,当选择其中一项时触发2. var checkText=$("#select_id").find("option:selected").text(); //获取Select选择的Text3. var checkValue=$("#select_id").val(); //获取Select选择的
语法解释:1. $("#select_id").change(function(){//code...}); //为Select添加事件,当选择其中一项时触发2. var checkText=$("#select_id").find("option:selected").text(); //获取Select选择的Text3. var checkValue=$("#select_id").val(); //获取Selec
js函数方法: <script> function getDefaultSelectedOption(selectId, valIfNull) { var selectId = selectId.replace(/^#/, ''), opts; try { opts = document.getElementById(selectId).getElementsByTagName('option'); for (var i in opts) { if (opts[i].defaultSelect