I have been using this method for a long time to set events for all classes (for buttons, etc.):
$("div.bigButton").mouseover(function() { this.style.backgroundColor = '#dfdfdf'; });
However, while doing some testing, I just noticed that when you move the mouse over these objects, the function works 3 times! This is invisible when changing something like backgroundColor, but if I add a warning, it is very obvious.
Any ideas what I'm doing wrong? I am concerned that this may affect performance in the future.
thank
EDIT: Sorry, missing "style" was sealed
HTML:
<div class="bigButton">
Test</div>
source
share