Jean LeLoup & Bob Ponterio SUNY Cortland © 2017 |
Syntax must be precisely correct, down to the semi-colon!
The example above uses a font color tag to set the color of the answer text. However, future browsers might prefer that you use a style instead to set the text color. Here is how that would look using <span style="color: white;"> to set the color of the word "allons":
<table border="1">
<tbody>
<tr>
<td style="background-color: white;"
onmouseover="this.style.backgroundColor='gray';"
onmouseout="this.style.backgroundColor='white';">
Answer:<strong> <span style="color: white;">allons</span> </strong></td>
</tr>
</tbody>
</table>
Answer: allons
Here is another use of JavaScript. Can you figure out what this does?
href="Javascript:void(0)" onclick="monatext.value='eyes';"
A couple of clues: href just means that something is in a clickable link. "monatext" is the name of a textbox.
In another lesson we will learn how to use this command to actually put feedback into a text box from a drop down box or radio button.
Hunt around her face to find something to click on.