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

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

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -