Code is as follows:
<div id="compare_view" align="center">
<div id="compv-navbar">
<img src="image1.png"> | <img src="image2.png"> | <img src="image3.png"> | Text can be here
</div>
</div>
I would like to be able to manipulate all of the images within the ‘compv-navbar’ div.
I know I could give each image a unique ID and select them that way, but I want to manipulate all the images within that compv-navbar div at the same time.
Edit: Sorry, I would like to select it with CSS. I thought it was obvious from the tags.
The first
idisn’t really necessary but makes it more specific and linear-like. You can go ahead and just use#compv-navbar imgif you want.If you want to manipulate with javascript,getElementByIdon#compv-navbarandgetElementsByTagName('img')using that as a context.jQuery-wise it would be$('#compv-navbar img')