LESSON 05B – YOUR OWN FUNCTION
WORK (GROUP)
a) Create a form
named form1 that has a text field named tf1 and a button. The button has an onClick attribute that
looks like this:
onClick= "myFunction();"
b) In the head
section of your html document, add the following:
<script type="text/javascript">
function myFunction()
{
form1.tf1.value = "Cool! ";
}
</script>
Comments:
|