$("- sharpcity"). On ("change",function () {
) var s=$("-sharpheader_right_imgs_ul>li");
for(var i=0;i<s.length;iPP){
if(s[i].className!= $(this).val()) {
console.log(s[i].className);
s[i].css({"display":"none"});
}
}
})
< hr >
< hr >
the above code li is dynamically rendered to-sharpheader_right_imgs_ul through ajax.-sharpcity is a select drop-down box. Each li has a different class name. I want to hide the li class name when the select is selected, console.log (s [I] .className); output this to successfully obtain each Li, but s[ I] .css ({"display": "none"}); Why can"t you change it? how to write and ask for passing seniors" advice? thank you!