From the course: JavaScript Essential Training

Unlock the full course today

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

Traditional string output

Traditional string output - JavaScript Tutorial

From the course: JavaScript Essential Training

Start my 1-month free trial

Traditional string output

- [Instructor] Template Literals are great for outputting HTML and other content mixed with JavaScript. However, this is a very new technology and chances are, you'll come across existing code and tutorials where Template Literals are never used, instead you'll see standard strings used. This is the classic way of outputting string content using plain old strings. It's a bit more convoluted, but it is and will be used. So it's worth knowing about. To show you this, I need to simplify my example, otherwise we'll just end up with way too much code. So I'm going to delete the entire Template Literal. And instead set content equal to a string that holds an h1 and name goes here, and then closes the h1. If I save this, we'll just get an h1 saying name goes here on the browser, because we are still doing the same thing we're still taking the value of this, injecting it into the inner HTML of the body and the document.…

Contents