HTML and CSS Reference
In-Depth Information
E-mail
<
br
>
<
input
type
=
text
name
=thirdInput>
Text
<
br
>
<
input
type
=
text
name
=fourthInput>
Text
<
br
>
<
input
type
=url
name
=fifthInput>
URL
<
br
>
<
textarea
cols
=
”15”
rows
=
”6”
name
=output></
textarea
>
<
input
type
=button
value
=
”Send to DOM”
onClick
=
”FormMaster.resolveForm()”
>
</
form
>
</section>
</article>
</
body
>
</
html
>
When you test the program, enter the appropriate text and numbers and them click the button,
Send to DOM. In the JavaScript program, notice that as long as either the element names or
their proper element name (or node name) is used, the entered materials are sent to the text
area that is used for an output display. Figure 14-3 shows the results you can expect to see.
292
Figure 14-3: User entries displayed on the page.
h e contents are retrieved through the DOM paths and placed into variables and then sent to
the
<textarea>
element for display. Between the i ve elements a constant (
const cr=”\n”
)
places a control character to force a line feed.