开发者

jquery find image based on "align"

开发者 https://www.devze.com 2023-01-03 03:43 出处:网络
I\'m trying to find all the images on a page based on their alignment (no class or id attached to these images), although I\'m not sure how to do it. Basically I want to add CSS to images which are al

I'm trying to find all the images on a page based on their alignment (no class or id attached to these images), although I'm not sure how to do it. Basically I want to add CSS to images which are aligned to the right, yet leave th开发者_开发问答e other images as they are.

If anyone could help out, that'd be great :)


What about img[align="top"] ?

http://api.jquery.com/attribute-equals-selector/


Have you tried this selector?

$('img[align=right]').addClass('onRight');

or if that doesn't work, it might help if you showed us some of your HTML

0

精彩评论

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