javascript - Why is mouseover function not working -
i have simplest of codes, i've never tried using onmouseover before, not sure why it's not working:
<div class="play" id="buttonplay"> <img src="buttons/play/playrest.png" onmouseover="this.src='buttons/play/playclick.png'" width="100%"> </div>
any ideas? , way go debugging it?
try declaring function in script element , reference function instead of doing inline. @ least way can set breakpoint in developper console of browser , see happening.
<div class="play" id="buttonplay"> <img src="buttons/play/playrest.png" onmouseover="myfunction(this)" width="100%"> </div> <script> function myfunction(element) { element.src='buttons/play/playclick.png'; } </script>
Comments
Post a Comment