The loop starts fine on mouseover, but it doesn't stop on mouseout! What am i doing wrong?
SCRIPT
<script type="text/javascript">
function iniciarep(x) {
var iddointervalo = setInterval(function(){ change(x); }, 500);
}
function terminarep() {
clearInterval(iddointervalo);
}
function change(x) {
**do stuff here (working fine)**
}
</script>
HTML
<img id="c3" src="letras/m1.svg" alt="m" onmouseover='iniciarep(this);' onmouseout='terminarep();'>