开发者

How to select all images inside any element whose class starts with "pajina" in jQuery?

开发者 https://www.devze.com 2023-03-18 15:12 出处:网络
I need to sele开发者_运维技巧ct like this var imgs = $(\'.pajina* img\'); Then I will do something else with the images variable later on....mas tarde$(\'[class*=\" pajina\"],[class^=\"pajina\"]\')

I need to sele开发者_运维技巧ct like this

var imgs = $('.pajina* img');

Then I will do something else with the images variable later on....mas tarde


$('[class*=" pajina"],[class^="pajina"]').find('img')

will select any elements starting with "pajina", or any elements with " pajina" in the class name, which happens with multiple class names.


Try this:

var imgs = $('[class*="pajina"] img');
0

精彩评论

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