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

Get and set with innerHTML - JavaScript Tutorial

From the course: JavaScript for Web Designers

Start my 1-month free trial

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…

Contents