+ 16
With the HTML DOM, JavaScript can access and change all the elements of an HTML document. When a web page is loaded, the browser creates a Document Object Model of the page. With the object model, JavaScript gets all the power it needs to create dynamic HTML: JavaScript can change all the HTML elements in the page JavaScript can change all the HTML attributes in the page JavaScript can change all the CSS styles in the page JavaScript can remove existing HTML elements and attributes JavaScript can add new HTML elements and attributes JavaScript can react to all existing HTML events in the page JavaScript can create new HTML events in the page "The W3C Document Object Model (DOM) is a platform and language-neutral interface that allows programs and scripts to dynamically access and update the content, structure, and style of a document."
19th Jul 2016, 12:06 PM
Mahima Rajvir Singh
Mahima Rajvir Singh - avatar
+ 7
A simpler answer could be to say once a web page loads a DOM is created based on the HTML elements on the page. The DOM reads those elements as objects and places them within a structure. The DOM can then take those individual objects and allow the user to freely manipulate them in a variety of different ways using instructions/commands written in Javascript. Simple as that đŸ€˜
13th Aug 2016, 4:10 PM
Nicholas Michael Rowe
Nicholas Michael Rowe - avatar
+ 4
You might want to read more about js objects and event handling / async coding if you really want to understand the DOM.
19th Jul 2016, 8:13 AM
gx021
gx021 - avatar
+ 1
yes she did a great copy/paste answer
13th Aug 2016, 2:28 AM
cleo patt
cleo patt - avatar
0
Good demonstration mahima Singh (y)
31st Jul 2016, 8:43 AM
Mohd Sohail Khan
Mohd Sohail Khan - avatar
0
very clear answer from Nicholas. HTML document => Object = DOM.
15th Sep 2016, 2:03 AM
Vico Arnanta Sasmita
Vico Arnanta Sasmita - avatar
0
Nicholas Michael Rowe, that was a beautiful explanation. please I would like to friend you on Facebook I can learn more from you. thanks
16th Sep 2016, 10:24 PM
Ilyas Ibrahim
0
When a web page is loaded, the browser creates a Document Object Model of the page. By treating the page (the document) as an object javascript can dynamically access and update its content, structure and style. .Html tags are seen as the elements of the document object. If e.g. the tag has an ID you can access its value in javascript using the getElementById method of the document object. ( syntax document.getElementById) Here is the simplest way how to get in JS a value from HTML html <input type='text' id='myText' /> JS var myTextField = document.getElementById('myText');.
19th Feb 2017, 7:57 PM
Palcsi Smartphone
Palcsi Smartphone - avatar