Skip to Main Content
Coding with JavaScript For Dummies
book

Coding with JavaScript For Dummies

by Chris Minnick, Eva Holland
May 2015
Beginner content levelBeginner
360 pages
6h 39m
English
For Dummies
Content preview from Coding with JavaScript For Dummies

Chapter 12

Integrating Input and Output

In This Chapter

arrow Working with forms

arrow Using input

arrow Sending output

Malfunction. Need Input.

— Number 5, Short Circuit (1986)

Handling user input and sending back results are basic and necessary functions for any computer program. In this chapter, you find out how JavaScript and HTML can work together to receive and output data.

Understanding HTML Forms

The primary way to get input from users of web applications is through HTML forms. HTML forms give web developers the ability to create text fields, drop-down selectors, radio buttons, checkboxes, and buttons. With CSS, you can adjust the look of a form to fit your particular website. JavaScript gives you the ability to enhance the functionality of your form.

The form element

All HTML forms are contained within a form element. The form element is the container that holds the input fields, buttons, checkboxes and labels that make up a user input area. The form element acts much like any container element, such as a div, article, or section. But it also contains some attributes that tell the browser what to do with the user input from the form fields it contains.

Listing 12-1 shows an ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

HTML5 Programming with JavaScript For Dummies

HTML5 Programming with JavaScript For Dummies

John Paul Mueller
JavaScript For Kids For Dummies

JavaScript For Kids For Dummies

Chris Minnick, Eva Holland

Publisher Resources

ISBN: 9781119056072Purchase book