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

Popular posts from this blog

java - SSE Emitter : Manage timeouts and complete() -

jquery - uncaught exception: DataTables Editor - remote hosting of code not allowed -

java - How to resolve error - package com.squareup.okhttp3 doesn't exist? -