0

jquery problems

so I'm having problems with my script in jquery here it is $('#ac').mouseenter(function() {$(this).css('background-color','orange')}); $('#ac').mouseleave(function() {$(this).css('background-color','red')}); $('#ac').click(function(){ $(this).css('background-color','yellow')}); does anyone know what I did wrong

31st Dec 2016, 9:00 PM
Christian Dooley
Christian Dooley - avatar
2 Answers
+ 1
$('#ac').hover(function () {}
31st Dec 2016, 10:25 PM
kallzo
kallzo - avatar
+ 1
The first line should be $('#ac').on("mouseover", function() { $(this).css({backgroundColor: 'orange'}) }); Write CSS properties in camelCase.
1st Jan 2017, 1:46 AM
David Sebastian Keshvi Illiakis
David Sebastian Keshvi Illiakis - avatar