/** * Created by bd2010141 on 2020/5/7. */ $(document).ready(function(){ var hot_list=["铜","铱","钯","镍","铑","钌"]; var has_hot=false; $.each(hot_list,function(idx,item){ var find=$(".two-menu ul a:contains('"+item+"')"); if(find.length>0){ find.addClass("hot"); has_hot=true; } }); if(has_hot){$(".two-menu").addClass("menu-hot");} })