Level 98
Level 100
9 words 0 ignored
Ready to learn
Ready to review
Ignore words
Check the boxes below to ignore/unignore words, then click save at the bottom. Ignored words will never appear in any learning session.
Ignore?
What allows Js to change the content of HTML element?
The HTML DOM allows JavaScript to change the content of HTML elements.
Changing the HTML Output Stream
Changing the HTML Output Stream0
JavaScript can create dynamic HTML content: example
Date: Sat Mar 28 2015 17:10:05 GMT+0100 (CET)
With which function can we write directly to the HTML output stream?
In JavaScript, document.write() can be used to write directly to the HTML output stream:
When is document.write() not allowed to use?
Never use document.write() after the document is loaded. It will overwrite the document.
What is the easiest way to modify the content of an HTML element?
The easiest way to modify the content of an HTML element is by using the innerHTML property.
What is the syntax for that?
To change the content of an HTML element, use this syntax:
previous Example explained:
The HTML document above contains an <h1> element with id="header"
document.getElementById(id).attribute=new value
To change the value of an HTML attribute, use this syntax: