Hi,
I am new here in this forum and I am currently studying JS. I need help with something but I couldn't find any existing problem like mine.
anyway, I just want to pick a random sound when Play button is clicked.
I just need something to start of then I might be able to do the rest.
anyway this is the Task that I'm trying to do:
Ask Question - when the start button is clicked, the computer should:
• change the text of the start button to ‘Play’ ( √ Done. )
• pick a random letter, disable the letter buttons,
• 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)
• enable the letter buttons.
Here is my HTML code in case you need it.
<title>Phonics</title>
<link rel="stylesheet" href="style.css" type="text/css"/>
<script type="text/javascript" src="jScript.js"></script>
</head>
<body>
<div id="container">
<div id="main" align="center">
<!-- Title Phonics start -->
<h1>Phonics</h1>
<!-- Title Phonics end -->
<!-- Start Button start -->
<input id="btnStart" name="btnStart" type="button" value="Start" onclick="btnStart_onClick()" />
<!-- Start Button end -->
<br /><br />
<!-- Letter Buttons start -->
<input id="btnA" type="button" value="A" disabled="disabled" />
<input id="btnE" type="button" value="E" disabled="disabled" />
<input id="btnI" type="button" value="I" disabled="disabled" />
<input id="btnO" type="button" value="O" disabled="disabled" />
<input id="btnU" type="button" value="U" disabled="disabled" />
<br />
<input id="btnB" type="button" value="B" disabled="disabled" />
<input id="btnH" type="button" value="H" disabled="disabled" />
<input id="btnT" type="button" value="T" disabled="disabled" />
<!-- Letter Button end -->
<!-- Empty Paragraph start -->
<p id="parFeed"></p>
<!-- Empty Paragraph end -->
<br /><br /><br /><hr />
<!-- Scoreboard start -->
Scoreboard:
<img id="start1" src="images/StarOff.gif" />
<img id="start2" src="images/StarOff.gif" />
<img id="start3" src="images/StarOff.gif" />
<img id="start4" src="images/StarOff.gif" />
<img id="start5" src="images/StarOff.gif" />
<!-- Scoreboard end -->
</div>
</div>
</body>
</html>
Thank You soo much!