I used a function in filter to check whether the display mode is block but it's not working.
Here's my code:
$("#wrap_element").find("*").filter(function(){
return this.css("display")==="block";
}).css("background-color","red");
Thanks.
You have a console error that hints at the problem:
Uncaught TypeError: this.css is not a function
You need to use a jQuery object since you're calling a jQuery method on it:
return $(this).css("display")==="block";
// ----^^----^
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.