do anyone know getElementByID or getElementByName be able to work on xhml on mobile?

the script is something like this:
===========================================
<script type="text/ecmascript">
function rollover(evt) {

document.getElementById("image1").src = "icon01_omo.png";

}
</script>
===========================================
mine doesn't work...