Forum Moderators: open
try it like this...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>untitled document</title>
<style media="screen">
#button {
display:block;
padding:0;
width:37px;
height:37px;
border:0;
}
.default {
background-image:url(he1.png);
color:transparent;
}
.clicked {
background-image:url(wi3.png);
color:transparent;
}
</style>
<script>
(function() {
'use strict';
function init(){
var test=true;
document.getElementById('button').onclick=function() {
if(test===true) {
this.className='clicked';
test=false;
}
}
}
window.addEventListener?
window.addEventListener('load',init,false):
window.attachEvent('onload',init);
})();
</script>
</head>
<body>
<input type="submit" id="button" class="default">
</body>
</html>
birdbrain