Hi guys, please help me out with this. I'm seriously considering suicide. I have three buttons that load numbers into divs. The problem I'm having is that the buttons only seem to work once. Any idea as to why this is happening? You help will go a long way.
<html>
<head>
<script type="text/javascript">
var easyGame = {
easy: [1,2,3],
s: 1,
easyLoad: function(){
for(i=0;i<=this.easy.length;i++){
document.getElementById(this.s).innerHTML=this.easy[i];
this.s++;
}
}//end of easyLoad function
}//end of easy game
var normalGame = {
normal: [4,5,6],
s: 1,
normalLoad: function(){
for(i=0;i<=this.normal.length;i++){
document.getElementById(this.s).innerHTML=this.normal[i];
this.s++;
}
}//end of normalLoad function
}//end of normal game
var hardGame = {
hard: [7,8,9],
s: 1,
hardLoad: function(){
for(i=0;i<=this.hard.length;i++){
document.getElementById(this.s).innerHTML=this.hard[i];
this.s++;
}
}//end of hardLoad function
}//end of hard game
</script>
</head>
<body onLoad="normalGame.normalLoad()">
<div id="1"></div>
<div id="2"></div>
<div id="3"></div>
<input type="button" value="easy" onClick="easyGame.easyLoad()"/>
<input type="button" value="normal" onClick="normalGame.normalLoad()"/>
<input type="button" value="hard" onClick="hardGame.hardLoad()"/>
</body>
</html>