As title says, I have a div. Somewhere (could be embedded in further child divs) will be images. Is it possible to assign a style to all of the images in this div that do not currently have a style?
EDIT:
<div id="testDiv">
<div>
<img id="testImage1" class="testclass1"/>
<img id="testImage2" />
</div>
<span>
<img id="testImage3"/>
<img id="testImage4" class="testclass2"/>
</span>
</div>
testImage2 and testImage3 (above) will have a class of testclass3 assigned to it.
Use the :not() selector to find the elements without a class and then use the addClass() to add a class.
Try this:
NB: I did a jsFiddle, but to see the result you have to Firebug through the results pane