Jquery changing background of parent div

I'm not 100% sure but I think what you need is what Phill Sacre's answer suggests except using parents (notice the last s)

From jQuery API:

parent( String expr ) returns jQuery Get a set of elements containing the unique parents of the matched set of elements.

parents( String expr ) returns jQuery Get a set of elements containing the unique ancestors of the matched set of elements (except for the root element).


I think using

$(this).parents('div.inputBoxImage').css(...)

instead of $(this.parentNode) should work.

See the jQuery traversing documentation

Edit: updated following Prody's answer (changed parent to parents)

Tags:

Html

Jquery