JavaScript HTML DOM Document

The HTML DOM document object is the owner of all other objects in your web page. The HTML DOM Document Object The document object represents your web page. If you want to access any element in an HTML page, you always start with accessing the document object. Below are some examples of how you can […]

JavaScript – HTML DOM Methods

HTML DOM methods are actions you can perform (on HTML Elements). HTML DOM properties are values (of HTML Elements) that you can set or change. The DOM Programming Interface The HTML DOM can be accessed with JavaScript (and with other programming languages). In the DOM, all HTML elements are defined as objects. The programming interface is the properties and methods of […]

JavaScript HTML DOM – Intro

With the HTML DOM, JavaScript can access and change all the elements of an HTML document. The HTML DOM (Document Object Model) When a web page is loaded, the browser creates a Document Object Model of the page. The HTML DOM model is constructed as a tree of Objects: The HTML DOM Tree of Objects With the object model, JavaScript gets […]

HTML DOM Section Object

Section Object  The Section Object is new in HTML5. The Section object represents an HTML <section> element. Note: The <section> element is not supported in Internet Explorer 8 and earlier versions. Access a Section Object You can access a <section> element by using getElementById(): Example var x = document.getElementById(“mySection”); Try it Yourself » Create a Section Object […]

HTML DOM Select Object

The Select object represents an HTML <select> element. Access a Select Object You can access a <select> element by using getElementById(): Example var x = document.getElementById(“mySelect”); Try it Yourself » Tip: You can also access a Select object by searching through the elements collection of a form. Create a Select Object You can create a <select> element by using […]

HTML DOM Small Object

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

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

The Script object represents an HTML <script> element. Access a Script Object You can access a <script> element by using getElementById(): Example var x = document.getElementById(“myScript”); Try it Yourself » Tip: You can also access a <script> element by using the scripts collection. Create a Script Object You can create a <script> element by using the document.createElement() method: Example […]

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

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

HTML DOM Pre Object

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

HTML DOM Parameter Object

Parameter Object The Parameter object represents an HTML <param> element. The <param> element is used to define parameters for plugins embedded with an <object> element. Access a Parameter Object You can access a <param> element by using getElementById(): Example var x = document.getElementById(“myParam”); Try it Yourself » Create a Parameter Object You can create a <param> […]

HTML DOM Output Object

Output Object  The Output Object is new in HTML5. The Output object represents an HTML <output> element. Note: The <output> element is not supported in Internet Explorer / Edge. Access an Output Object You can access an <output> element by using getElementById(): Example var x = document.getElementById(“myOutput”); Try it Yourself » Tip: You can also access an <output> […]

HTML DOM Option Object

Option Object The Option object represents an HTML <option> element. Access an Option Object You can access an <option> element by using getElementById(): Example var x = document.getElementById(“myOption”); Try it Yourself » Tip: You can also access an Option object by searching through the elements collection of a form, or the options collection of a drop-down list. Create an Option Object […]

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

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

HTML DOM OptionGroup Object

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

HTML DOM Object Object

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

HTML DOM Textarea Object

Textarea Object The Textarea object represents an HTML <textarea> element. Access a Textarea Object You can access a <textarea> element by using getElementById(): Example var x = document.getElementById(“myTextarea”); Try it Yourself » Tip: You can also access a <textarea> element by searching through the elements collection of a form. Create a Textarea Object You can create a <textarea> element […]

HTML DOM Link Object

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