The HTML DOM Document Object

When an HTML document is loaded into a web browser, it becomes a document object. The document object is the root node of the HTML document. Document Object Properties and Methods The following properties and methods can be used on HTML documents: Property / Method Description activeElement Returns the currently focused element in the document addEventListener() […]

HTML DOM Source Object

Source Object  The Source Object is new in HTML5. The Source object represents an HTML <source> element. Access a Source Object You can access a <source> element by using getElementById(): Example var x = document.getElementById(“mySource”); Try it Yourself » Create a Source Object You can create a <source> element by using the document.createElement() method: Example var x […]

HTML DOM S Object

S Object The S object represents an HTML <s> element. Access a S Object You can access a <s> element by using getElementById(): Example var x = document.getElementById(“myS”); Try it Yourself » Create a S Object You can create a <s> element by using the document.createElement() method: Example var x = document.createElement(“S”); Try it Yourself » Standard […]

HTML DOM Area Object

Area Object The Area object represents an HTML <area> element. Access an Area Object You can access an <area> element by using getElementById(): Example var x = document.getElementById(“myArea”); Try it Yourself » Create an Area Object You can create an <area> element by using the document.createElement() method: Example var x = document.createElement(“AREA”); Try it Yourself » Area […]

HTML DOM Address Object

Address Object The Address object represents an HTML <address> element. Access an Address Object You can access an <address> element by using getElementById(): Example var x = document.getElementById(“myAdr”); Try it Yourself » Create an Address Object You can create an <address> element by using the document.createElement() method: Example var x = document.createElement(“ADDRESS”); Try it Yourself » Standard […]