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 Summary Object

Summary Object  The Summary Object is new in HTML5. The Summary object represents an HTML <summary> element. Note: The <summary> element is currently only supported in Chrome, Safari 6+ and Opera 15+. Access a Summary Object You can access a <summary> element by using getElementById(): Example var x = document.getElementById(“mySummary”); Try it Yourself » Create a Summary […]

HTML DOM Code Object

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