HTML and CSS Reference
In-Depth Information
window
document
form
textarea
Figure 11.32
How the
textarea
object is created within the JavaScript hierarchy.
EXAMPLE
11.20
<html>
<head><title>Text Area Boxes</title></head>
<font face="verdana">
<body bgcolor="lightgreen">
<font face="verdana">
<form name="form1">
<strong>
Finish the story
</strong><br />
1
<textarea name="story" rows="8" cols="60" >
Once upon a time, there were three little ...
</
textarea>
</form>
<script type="text/javascript">
document.write( "The type of the input device is:<em> "+
2
document.form1.story.type
);
document.write( "<br /></em>The text area is named:<em> "+
3
document.form1.story.name
);
document.write("<br /></em>The number of rows in the "+
4
"text area is:<em> "+
document.form1.story.rows
);
document.write("<br /></em>The value in the text area is:<em>"
5
+
document.form1.story.value
);
document.write( "<br /></em>The number of cols in the text "
6
+ "area is:<em>"+
document.form1.story.cols
);
</script>
</font>
</body>
</html>