Reply
Thu 27 Jul, 2017 09:53 am
Hi there,
I am making a project with javascript. The main outline of the project is like this:
when the start button is clicked, the computer should:
enable the letter buttons
change the text of the start button to ‘Play’
pick a random letter,
randomly decide whether to use a boy or girl’s voice
play the corresponding sound for the randomly selected letter
(clicking the play button repeatedly should not change the letter)
Here's my code so far,
<html>
<head>
<title>Phonics</title>
</head>
<body bgcolor="Orange">
<center><h1><font>Phonics</font></h1></center>
<p align = "center"><input id = "btnStart" type = "button" value = "Start" onClick="btnStart_onClick()" /></p>
<div class = "container"> </div>
<center>
<input disabled value = "A" id = "BtnA" type = "button" onclick = "BtnA_onClick()"/>
<input disabled value = "E" id = "BtnE" type = "button" onclick = "BtnE_onClick()"/>
<input disabled value = "I" id = "BtnI" type = "button" onclick = "BtnI_onClick()"/>
<input disabled value = "O" id = "BtnO" type = "button" onclick = "BtnO_onClick()"/>
<input disabled value = "U" id = "BtnU" type = "button" onclick = "BtnU_onClick()"/>
<input disabled value = "B" id = "BtnB" type = "button" onclick = "BtnB_onClick()"/>
<input disabled value = "H" id = "BtnH" type = "button" onclick = "BtnH_onClick()"/>
<input disabled value = "T" id = "BtnT" type = "button" onclick = "BtnT_onClick()"/>
</center>
<center></center>
<center>
<img id = "Star1" src = "star-g.GIF" width = "40"/>
<img id = "Star2" src = "star-g.GIF" width = "40"/>
<img id = "Star3" src = "star-g.GIF" width = "40"/>
<img id = "Star4" src = "star-g.GIF" width = "40"/>
<img id = "Star5" src = "star-g.GIF" width = "40"/>
</center>
</body>
</html>
<script language = "javascript">
BtnA.disabled = false;
BtnE.disabled = false;
BtnI.disabled = false;
BtnO.disabled = false;
BtnU.disabled = false;
BtnB.disabled = false;
BtnH.disabled = false;
BtnT.disabled = false;
//function btnStart_onClick() {
// Answer = 1 + parseInt(Math.random() * 10);
// if Answer
//}
</script>