JavaScript Tutorial




Lesson 6 - Documents




Documents are one of the only things that can get something from HTML for you to edit. You have to do document.getElementById("Id").property = set; You have to create an id in html like this

Use any tag and id. Put it in the "Id" section of the document.getElementById("Id"), then edit.

Here are some options. innerHTML, where you can change text, src, to set a image source for the image, and styles, like style.display , to make something visible, style.borderColor, to add a border color, you get the point.

Documents get the thing you want by putting in its id, and allows you to edit it, in JS.


< Previous------------------------- Next >