From the course: JavaScript: Web Form Programming

Unlock the full course today

Join today to access over 22,700 courses taught by industry experts or purchase this course individually.

Using the output element

Using the output element

From the course: JavaScript: Web Form Programming

Start my 1-month free trial

Using the output element

- [Instructor] One of the common use cases for forms is to perform calculations using the values of form fields, and then to display the results to the user. For example, an online shopping site might calculate the cost of all the items in a shopping cart or a delivery site might display the total of an online order together with tax and optional gratuity for the driver and so on, there's plenty of examples. So the HTML standard actually provides a tag for this purpose and it's called the output tag and that's what we're going to examine in this example. So I have the HTML spec open for form elements and I'll click on the output element. And you can read more about the output tag here at your convenience, but essentially it's intended to represent the result of a calculation that the application performs. And if we go back over to the code, you can see here that I've opened up the output elem_start file in my browser,…

Contents