var options = document.getElementById('ppId').children;
$.each(options,function(){
if($(this).attr("brand-name")==rows[i].brandName){
$(this).attr("selected","selected");
return;
}
});
----------------------------------------------------------------------------

jS笔记记录------js设置select标签选择
最新推荐文章于 2025-08-21 09:42:52 发布
本文探讨了使用jQuery遍历DOM元素并设置属性的具体实现方式,通过实例代码展示了如何在循环中查找匹配特定属性的元素并为其设置'selected'属性。
1211

被折叠的 条评论
为什么被折叠?



