开发者

quick jquery each loop question

开发者 https://www.devze.com 2023-02-17 17:47 出处:网络
I开发者_运维知识库f i write $(\'.myclass\').each(function () {}); and there are no elements of myclass on a particular page, will it create problems?

I开发者_运维知识库f i write

$('.myclass').each(function () {});

and there are no elements of myclass on a particular page, will it create problems?

Thanks.


no you will be fine, it will basically do nothing. If jQuery finds no elements named ".myclass" it just continues on.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号