Content deleted Content added
GrapesRock (talk | contribs) Revert changes by IP as they don't seem to be true |
Re-added 'eloquent' to the description of Javascript frameworks. |
||
Line 129:
</syntaxhighlight>Another way to create a DOM structure is using the innerHTML property to insert HTML code as a string, creating the elements and children in the process. For example:<syntaxhighlight lang="javascript">
document.getElementById("root").innerHTML = "<child></child>";
</syntaxhighlight>Another method is to use a JavaScript library or framework such as [[jQuery]], [[AngularJS]], [[React (JavaScript library)|React]], [[Vue.js]], etc. These libraries provide a more convenient, eloquent and efficient way to create, manipulate and interact with the DOM.
It is also possible to create a DOM structure from an XML or JSON data, using JavaScript methods to parse the data and create the nodes accordingly.
|