can anyone let me know how to remove (onmouseover="mouseoversound.playclip()") in the below html
<a href="roster.html" onmouseover="mouseoversound.playclip()">Roster</a>
Instead of this can we use in js file i.e. #nav li a hover event play clip. Below is the reference link: javascriptkit.com/script/script2/soundlink.shtml
I think that the responders didn't fully read your question. Since the event is bound inline (which someone mentioned IS deprecated) we can just remove the onmouseover attribute within the anchor.
In the example below, I've just attached an onclick inline event. Clicking the link will remove the event bind.
You can do with in straight JavaScript:
<a href="roster.html" onmouseover="mouseoversound.playclip()" onclick="this.removeAttribute('onmouseover')">Roster</a>
Without using an inline onclick on that element, you could just use this:
<a id="Link1" href="roster.html" onmouseover="mouseoversound.playclip()">Roster</a>
<a href="javascript:void(0);" onclick="document.getElementById('Link1').removeAttribute('onmouseover')">Remove onmouseover</a>
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