jquery对select操作 文章摘自:http://blog.sina.com.cn/s/blog_49cc672f0100cd28.html[code]//遍历option和添加、移除option function changeShipMethod(shipping){ var len = $("select[@name=ISHIPTYPE] option").length if(shipping.value != "CA"){ $("select[@name=ISHIPTYPE] option").each(function(){ if($(this).val() == 111){ $(this).remove(); } }); }else{ $("
jquery对select操作 [转] [code] //遍历option和添加、移除option function changeShipMethod(shipping){ var len = $("select[@name=ISHIPTYPE] option").length if(shipping.value != "CA"){ $("select[@name=ISHIPTYPE] option").each(function(){ if($(this).val() == 111){ $(this).remove(); } }); }else{ $("").appendTo($("select[@name=ISHIPTYPE]")); } } ...
[code]一 、select jquery获取select选择的Text和Value: 1. $("#select_id").change(function(){//code...}); //为select添加事件,当选择其中一项时触发 2. var checkText=$("#select_id").find("option:selected").text(); //获取select选择的Text 3. var checkValue=$("#select_id").val(); //获取select选择的Value 4. var checkIndex=$("#select_id ").get(0).selectedIndex; //获取select选择的索引值 5. var maxIndex...
[code]jquery获取select选择的Text和Value: 语法解释: 1. $("#select_id").change(function(){//code...}); //为select添加事件,当选择其中一项时触发 2. var checkText=$("#select_id").find("option:selected").text(); //获取select选择的Text 3. var checkValue=$("#select_id").val(); //获取select选择的Value 4. var checkIndex=$("#select_id ").get(0).selectedIndex; //获取select选择的索引值 5. var maxIndex=$...
jquery操作checkbox、radio Js代码[code]1.(引自 daysmileface的博客) 2. 3. 4. 5. 6. 7.例:将多个选中的checkbox的值组装成一个字符串 8. 9.