如何遍历div里面的文本内容,用each方法,

如何遍历div里面的文本内容,然后进行匹配传来的数据,进行选中div,并进行CSS样式处理,

 

for(i = 0; i< $(".itemMenuRowBox").children().length;i++){
$(".itemMenuRowBox").children("div").each(function(){
if(plate.name==$(this).text()){
$(".itemMenuRow").css({"background-color":"#fff","color":"#000000","font-weight":"bold"});
$(this).css({"background-color": "rgba(226, 215, 214, 0.52)","color":"#FF0000","font-weight":"bold"});
}
});

posted on 2017-03-02 18:03  胡小西去哪儿了  阅读(420)  评论(0编辑  收藏  举报

导航