Start learning with our library of video tutorials taught by experts. Get started
Viewed by members. in countries. members currently watching.
This course introduces web designers to the nuts and bolts of HTML (HyperText Markup Language), the programming language used to create web pages. Author Bill Weinman explains what HTML is, how it's structured, and presents the major tags and features of the language. Discover how to format text and lists, add images and flow text around them, link to other pages and sites, embed audio and video, and create HTML forms. Additional tutorials cover the new elements in HTML5, the latest version of HTML, and prepare you to start working with Cascading Style Sheets (CSS).
So we have e = document.getElementById ("output") and now this e variable is that element and we can use a property on that inner HTML to actually change the contents of that output element, and that output element is span in this case, and it has a 0 there, but it'll have different numbers as we increment our counter. So let's go ahead and save this and open it in the browser. I am going to open this in Firefox, and there we have it, and you see, there it is, counting away 1, 2, 3, 4, et cetera.
As I said, this id attribute is often used for stylesheets, and in fact I can come in here and I can say style and I can use it as a CSS selector. And now I can do things to that output element, like for instance I can change its color, make it a little bit reddish. I can give it a background color and I can give it a border. When I save this and load it up in the browser, I'll just hit Reload here. See we start at 0 again when I reload, and there it is.
Well, the reason we don't do that is that that doesn't work. It doesn't work in several browsers that I've tried, in fact off the top of my head I seem to remember it worked in one or two browsers, but I don't remember which ones they were. It definitely does not work in Firefox. So in this case and in this case alone, you need to actually use the begin tag and the end tag, and it needs to be completely empty. You can't do that. It needs to be completely empty. So you notice my source says count.js. If we can open up count.js in our text editor and you can see it's exactly the same code, and when I load this in my browser you'll notice that it works just great.
Find answers to the most frequently asked questions about HTML Essential Training.
Here are the FAQs that matched your search "":
Sorry, there are no matches for your search ""—to search again, type in another word or phrase and click search.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.