November 11, 2014
<p onclick="aFunction()"> This is some text. </p>
In the above code, I tell the browser that if someone clicks on the paragraph tag, that the ‘aFunction’ function should be activated. Nerds will refer to this asÂ Â ‘calling a function’ instead of activating.
The Death of onMouseover?
The onMouseover event listener ‘listens’ for someone to hover their mouse over the element (HTML tag) that it is bound to – like what we did with the paragraph tag above and the onclick event.
It’s a sweet effect and works on all the browsers, except it doesn’t work on mobile devices – that sucks! You have to remember that within a few years, more than 50% of the Web’s traffic will be mobile traffic – people using smartphones and tablets.
Basically, that means you should probably not use onMouseover event listeners.