javascript - Finding an item without ID -


i've got set of divs different classes. there 40 divs 4 classes set randomly. need jquery script makes "background-color: white" on every grid-item click. tried this:

$('.grid-item').click(function(){ $(this).css("background-color", "white"); }) 

but wasn't idea guess.. ..because didn't work!

can me out, please?

$('body').on('click', 'div', function(e){    $(this).css("background-color","white"); }); 

Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -