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
Post a Comment