Jquery遍历select option和添加移除option的实现方法
2016-08-26 10:57
1056 查看
如下所示:
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{ $("<option value='111'>UPS Ground</option>").appendTo($("select[name=ISHIPTYPE]")); } }
以上这篇Jquery遍历select option和添加移除option的实现方法就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持脚本之家。
您可能感兴趣的文章:
相关文章推荐
- jQuery对select遍历option(添加、移除)
- jQuery对select遍历option(添加、移除)
- JQuery动态添加Select的Option元素实现方法
- jquery动态添加以及遍历option并获取特定样式名称的option方法
- a标签跳转到指定div,jquery添加和移除class属性的实现方法
- JQuery中DOM实现事件移除的方法
- jQuery实现html表格动态添加新行的方法
- 两种方法使用jquery实现左右移动效果(包含each遍历方式)
- jQuery实现为图片添加镜头放大效果的方法
- jQuery实现html表格动态添加新行的方法
- jQuery 添加/移除CSS类实现代码
- jQuery 添加/移除CSS类实现代码
- JQuery实现样式设置、追加、移除与切换的方法
- jQuery移除tr无效的解决方法(tr是动态添加)
- JQuery实现动态添加删除评论的方法
- jQuery 遍历ul li 添加 移除(代码收集)
- 两个select之间option的互相添加操作(jquery实现)
- jquery随意添加移除html的实现代码