Is there a way of targeting nested elements by class name? In the example below, I want to be able to attach a "click" event to all divs with ".car" class applied and then control the children within the ".car" div that is clicked. None of the children can have unique IDs unfortunately. Any ideas anyone? I've tried a few combinations but no success :(
HTML: <div class="car"> <div class="car_price">content here<div> <div class="car_details">content here<div> <div class="car_photos">content here<div> <div> The JS: if($(".car").length > 0){ $(".car").click(function(){ do stuff to specific child elements }); }