try this
var main = $("#main")
main.on("mouseenter", function () {
this.style = "background-color: #888;";
});
main.on("mouseleave", function () {
this.style = "background-color: white";
});
main
is a
jquery object which does not contain
style
property, so you need to use "
this
" to access the style property of the element