Nandagiri Akhilesh Nandagiri Akhilesh - 6 months ago 14
Javascript Question

calling onmouseover funtion multiple times

I have multiple div's and i have unique code for each div and whenever user comes across a specific div i want only that div to be counted.

My problem is if i use onmouseover-html then the function which is triggered is running multiple times.

There are posts which suggest to use mouseenter-jquery thing but If i use mouseenter-jquery i don't know how to get the unique code of div's.

I tried onmouseover and server got too busy and failed.

Answer

Try this

$('some-div').mouseenter(function(){ 
    console.log(this); 
    console.log($(this)); 
});
Comments