When I tried to validate this code in https://validator.w3.org/
<!doctype html>
<html>
<head><title>onmouseenter validation</title>
</head>
<body>
<div onmouseenter="javascript:alert('hello');">Event Validation</div>
</body>
</html>
The following error appears
"Attribute onmouseenter not allowed on element div at this point."
Somebody know why the validator keeps telling is an error?
I believe that onmouseenter is a valid attribute for a html element.
Your code is perfectly valid. The spec clearly states that onmouseenter
is a valid event handler on all HTML elements in HTML5. There is no change in the HTML 5.1 spec at the present time.
Substituting onmouseover
produces no errors in the validator, leading me to believe this is merely a bug on their end. This bug does not appear to have been reported, so I would recommend filing one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With