O'Reilly logo

The Book of JavaScript, 2nd Edition by thau!

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Form Basics

Figure 7-4 shows a simple form displayed in a browser, and Figure 7-5 shows the HTML behind that form.

A simple HTML form

Figure 7-4. A simple HTML form

HTML code for the basic form shown in

Figure 7-5. HTML code for the basic form shown in Figure 7-4

Text Fields

As you can see in Figure 7-4, the HTML in Figure 7-5 draws two text boxes on the screen. A visitor to your site can click inside the text boxes and type a name and age.

Notice that the form is constructed of normal HTML. Like most HTML, the form must go between the <body> and </body> tags. The form begins with a <form> tag and ends with ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required