From the course: JavaScript for Web Designers
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Get and set with innerHTML - JavaScript Tutorial
From the course: JavaScript for Web Designers
Get and set with innerHTML
- [Instructor] There's one more thing we'd like to do with this estimator, show a little bit more of our work when we're making that estimate and displaying it. How many items were to be purchased, what the total shipping cost is, and what the tax rate is. This will be the first time we're modifying the content of the page directly, not just changing values or states in the form. So let's go back over to our editor and get started. We're going to scroll down to where we calculate and display our final estimate, and I'm going to set myself a couple of place holders here, the total items, total shipping cost, and the tax, just as a reminder. To start off, I'm going to get a reference to the place where these data will eventually be displayed. We'll call it the results. I'm going to use document.getElementById and I need the ID so let's go back over to Firefox. I'm going to right click this general vicinity and hope that…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Working with user info4m 44s
-
Text fields and select boxes5m 45s
-
(Locked)
Radio buttons and checkboxes5m 30s
-
(Locked)
Changing submission with events4m 21s
-
(Locked)
Starting to validate input4m 15s
-
(Locked)
Disabling and enabling fields5m 14s
-
(Locked)
The basics of sanitizing user input7m 1s
-
(Locked)
Get and set with innerHTML6m 58s
-
(Locked)
Challenge: Add and use more fields56s
-
(Locked)
Solution: Add and use more fields3m 23s
-
(Locked)
-
-
-
-