I am looking to dynamically change the CSS of a div using jQuery when it is clicked. The challenge I am facing is that there are multiple divs with the same class and I am unable to modify their classes as they are created dynamically using PHP.
<div class="divphoto">
<img src="photo1.jpg">
</div>
<div class="divphoto">
<img src="photo2.jpg">
</div>
<div class="divphoto">
<img src="photo3.jpg">
</div>
<div class="divphoto">
<img src="photo4.jpg">
</div>
$(".divphoto").click(function(){
$(".divphoto").toggleClass("zoom");
});