{"id":1427,"date":"2019-12-20T08:32:58","date_gmt":"2019-12-19T21:32:58","guid":{"rendered":"https:\/\/www.dynamicwebtraining.com.au\/blog\/?p=1427"},"modified":"2025-01-06T11:34:34","modified_gmt":"2025-01-06T00:34:34","slug":"javascript-dom-methods","status":"publish","type":"post","link":"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods","title":{"rendered":"Top 10 Essential JavaScript DOM methods List"},"content":{"rendered":"\n<p>As a programmer, whether you are working on a project or building a script from scratch, there are few DOM methods every programmer should know. However, tools like MooTools or jQuery might perform these methods without any user interference (behind the scenes).&nbsp;<\/p>\n\n\n\n<!--more-->\n\n\n\n<br>\n\n\n\n<p>In the real world, whether you work in an IT industry or as a freelancer, you may have to work on existing scripts rather than new projects. So you may not be allowed to use libraries or tools.\u00a0<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"536\" src=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2019\/12\/Top-10-Essential-JavaScript-DOM-methods-Feature-1024x536.jpg\" alt=\"JavaScript DOM methods List - Dynamic Web Training\" class=\"wp-image-1429\" srcset=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2019\/12\/Top-10-Essential-JavaScript-DOM-methods-Feature-1024x536.jpg 1024w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2019\/12\/Top-10-Essential-JavaScript-DOM-methods-Feature-300x157.jpg 300w, https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2019\/12\/Top-10-Essential-JavaScript-DOM-methods-Feature.jpg 1200w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<br>\n\n\n\n<p><\/p>\n\n\n\n<p>Whatever is the reason, these DOM methods are basic and yet essential. You may have to use these methods throughout their careers. Mainly there are just ten important ones as follows:<\/p>\n\n\n\n<br>\n\n\n\n<h2 class=\"wp-block-heading\">JavaScript DOM methods<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. getElementId<\/h3>\n\n\n\n<p>getElementId is a method to access any element virtually. It accesses the first element with the specified ID.<\/p>\n\n\n\n<p><strong>Syntax:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myVariable = document.getElementById(\u201cmy_squad\u201d);<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>It can also be used dynamically as follows:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myVariable = document.getElementById(mySquad);<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>This method places object which needs to be accessed in a variable called \u201cmyVariable\u201d. myVariable allows your program to access object directly.<\/p>\n\n\n\n<p>Suppose you need to find an id \u201cSY\u201d, you just need to use the above syntax &amp; replace \u201cmy_element\u201d with \u201cSY\u201d. Secondly, you can also apply few additional codes on getElementById as follows:<\/p>\n\n\n\n<br>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myVariable = document.getElementById(\u201cSY\u201d);\nmyVariable.style.display = \u201cblock\u201d;\nmyVariable.style.backgroundColor = \u201c#f00\u201d;\nmyVariable.style.border = \u201csolid 1 px #00f\u201d;<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Here the above code will display in block font with a Hex-red background &amp; blue border. So using myVariable code you can add font &amp; color. A lot of people face trouble using getElementId usually because of silly mistakes. <\/p>\n\n\n\n<p>Consider the following example:<\/p>\n\n\n\n<br>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">myVariable = document.getElementByID(\u201cmy_squad\u201d);<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Here it might look correct, but remember, \u201cJavaScript is a case sensitive language.\u201d So \u201cID\u201d won\u2019t work in place of \u201cId.\u201d<\/p>\n\n\n\n<p>Usually, beginners commit this mistake &amp; find methods to be complicated. Meanwhile, code might look a bit messed up because you need to apply an id in your HTML. So this method is robust but may look messy as it encourages you to mess up your markup.<\/p>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">2. getElementsByTagName:<\/h3>\n\n\n\n<p>In the previous method, we may have some errors. But this method can eradicate those issues. getElementByTagName allows you to search all the elements with a specified tag name on your page.&nbsp;<\/p>\n\n\n\n<br>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myLinkcollection = document.getElementsByTagName(\u201cabc\u201d);<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Here myVariable is substituted by \u201cmyLinkCollection\u201d. myLinkCollection holds all the elements on the page. Pictorially it is like an array holding elements. Here also you can add few additional features. Following is an example:<\/p>\n\n\n\n<br>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myLinkCollection = document.getElementsByTagName(\u201cabc\u201d);\nfor (i = 0; i &lt; myLinkCollection.length; i++) {\n    if (myLinkCollection[i].className == \u201cstd_class\u201d) {\n        myLinkCollection[i].onclick = function() {\n            this.style.backgroundColor = \u201c#f00\u201d;\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>The above code isn\u2019t complicated if you know the basics &amp; use of methods. Here, when you collect the link into an array i.e., myLinkCollection, we use for loop to navigate.<\/p>\n\n\n\n<p>Next, if the loop sets a condition if class_Name equal to \u201cstd_class\u201d, there\u2019s a trigger attached to it using \u201conclick.\u201d The trigger is \u201cBackground color.\u201d<\/p>\n\n\n\n<p>If we can use link in getElementById why should we use getElementByTagName? Well, using id allows you to access only one element. Because it can have \u201cid\u201d but not \u201cids.\u201d So for each element, you need to use multiple getId elements. Meanwhile, ByTagName allows you to have multiple links with the same class name. We can set onclick triggers in a precise manner.<\/p>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">3. Node:<\/h3>\n\n\n\n<p>Any element on a page including text &amp; whitespaces of a DOM structure is known as \u201cNODE.\u201d Nodes can be between XHTML Tags.<\/p>\n\n\n\n<p>Nodes available in DOM:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>node.childNodes<\/li>\n\n\n\n<li> node.firstChild<\/li>\n\n\n\n<li> node.lastChild<\/li>\n\n\n\n<li> node.parentNode<\/li>\n\n\n\n<li> node.nextSibling<\/li>\n\n\n\n<li> node.previousSibling<\/li>\n<\/ul>\n\n\n\n<p>Suppose we have following XHTML:<\/p>\n\n\n\n<br>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"markup\" class=\"language-markup line-numbers\">&lt;ul id-\u201clist\u201d>\n    &lt;li>&lt;a href=\u201dprod1.html\u201d class=\u201dlist_one\u201d> Product Number One&lt;\/a>&lt;\/li>\n    &lt;li>&lt;a href=\u201dprod2.html\u201d> Product Number Two&lt;\/a>&lt;\/li>\u00a0\n    &lt;li>&lt;a href=\u201dprod3.html\u201d> Product Number Three&lt;\/a>&lt;\/li>\n    &lt;li>&lt;a href=\u201dprod4.html\u201d> Product Number Four&lt;\/a>&lt;\/li>\n&lt;\/ul><\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Now if we want to access \u201cProd1\u201d we can do so using 2 ways:<\/p>\n\n\n\n<p>Using ChildNodes:<\/p>\n\n\n\n<br>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myLinkList = document.getElementsById(\u201clist\u201d)\nvar myFirstProduct = myLinklist.childNodes[0].childNodes[0];\nalert(myFirstLink.className);<\/code><\/pre>\n\n\n\n<br\/>\n\n\n\n<p>Using firstChild:<\/p>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myLinkList = document.getElementsById(\u201clist\u201d)\nvar myFirstProduct = myLinklist.firstChild.firstChild;\nalert(myFirstLink.className);<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Both codes will display the same results because the same element is accessed. Different browsers may give different outputs.<\/p>\n\n\n\n<p>For example, Firefox\u2019s output would be different than Chrome because it views whitespaces as nodes. Nodes can be interpreted differently. So be selective &amp; carefully while using &amp; test nodes.<\/p>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">4. createElement:<\/h3>\n\n\n\n<p>As the name goes, it is used to create an element &amp; place it anywhere in the DOM structure. Let\u2019s add an element to the previous example:<\/p>\n\n\n\n<br\/\/>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myNewListItem = document.createElement(\u201cli\u201d)\nvar myNewProd = document.createElement(\u201cprod5\u201d);<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Here a new element will be created &amp; added in the DOM structure.<\/p>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">5. appendChild:<\/h3>\n\n\n\n<p>Previously we created element, now we will add two elements to our list of links using appendChild.<\/p>\n\n\n\n<br>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myNewListItem = document.createElement(\u201cli\u201d)\nvar myNewProd = document.createElement(\u201cprod5\u201d);\nvar myLinkList = document.getElementById(\u201cList\u201d)\nmyLinkList.appendChild(myNewListItem);\nmyLinkList.LastChild.appendChild(myNewProd);<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Above the code adds anchor tag inside of <br> element at the endpoint. If we can create or append, then we can remove it too.<\/p>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">6. removeChild:<\/h3>\n\n\n\n<p>o remove the effect of appendChild, we can use removeChild. Here, we need to remove the list item because it includes both \u201clist item &amp; newly created anchor.\u201d And, if we didn\u2019t create a new element, it might remove the last list item.<\/p>\n\n\n\n<p>It doesn\u2019t matter whether it was created recently or it existed. Following is a code to remove Child method:<\/p>\n\n\n\n<br>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myLinkList = document.getElementById(\u201clist\u201d)\nvar myRemovedLink = myLinkList.lastChild;\nmyLinkList.removeChild(myRemoveLink);<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">7. getAttribute:<\/h3>\n\n\n\n<p>With the getAttribute method, you can access the value of any attribute of an element on a page. Suppose there\u2019s an id with abc attribute having value \u201cBest.\u201d&nbsp;<\/p>\n\n\n\n<p>Now, if we want to retrieve that attribute, we will use getAttribute.&nbsp;<\/p>\n\n\n\n<p>Following is an example:<\/p>\n\n\n\n<br>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myLinkFive = document.getElementById(\u201cProd_5\u201d);\nvar myLinkAttribute = myLinkFive.getAttribute(\u201cabc\u201d);<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Now getAttribute will retrieve the value from \u201cabc,\u201d i.e., \u201cBest.\u201d This method is used to target links with specific attributes &amp; values.&nbsp;<\/p>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">8. setAttribute:<\/h3>\n\n\n\n<p>A useful method to replace values in the attribute. Assigning a new value to an existing attribute is done using setAttribute. Suppose we have an attribute \u201cabc\u201d containing value \u201cBest.\u201d&nbsp;<\/p>\n\n\n\n<p>Now we want to change the value to \u201cAwesome.\u201d Following is a suitable code:<\/p>\n\n\n\n<br>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">Var myLinkFive = document.getElementById(\u201cProd_5);\nmyLinkFive.setAttribute(\u201cabc\u201d, \u201dAwesome\u201d);<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Here, the value inside the abc attribute has been replaced. This method cannot change attributes; it can only make changes in values of an attribute.<\/p>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">9. document.forms:<\/h3>\n\n\n\n<p>This method is used to access \u201cform\u201d collections of the DOM structure. Usually, every website uses a \u201cdocument.form\u201d syntax. We might have used getElementById or TagName, but for accessing form, this method is the best.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<br>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"markup\" class=\"language-markup line-numbers\">&lt;form id=\u201dmy_form\u201d method=\u201dpost\u201d action=\u201dabc.html\u201d>\n    &lt;input type=\u201dcheckbox\u201d value=\u201done\u201d name=\u201doptions\u201d id=\u201doption1\u201d checked=\u201dchecked\u201d \/>One &lt;\/br>\n    &lt;input type=\u201dcheckbox\u201d value=\u201dtwo\u201d name=\u201doptions\u201d id=\u201doption2\u201d \/> Two &lt;\/br>\n    &lt;input type=\u201dcheckbox\u201d value=\u201dthree\u201d name=\u201doptions\u201d id=\u201doption3\u201d \/> Three &lt;\/br>\n&lt;\/form><\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Let\u2019s find out the \u201cChecked\u201d state:<\/p>\n\n\n\n<br\/>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">var myCheckBoxOne = document.forms[\u201cmy_form\u201d][\u201coption1\u201d];\nalert(myCheckBoxOne.checked);<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Here, the result would be \u201cTrue.\u201d But if the same check is done on option2 or 3, we will get \u201cFalse.\u201d<\/p>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">10. innerHTML:<\/h3>\n\n\n\n<p>The last &amp; final method is innerHTML, an interesting one. It\u2019s supported on mostly every browser or platform. However, it\u2019s a nonstandard element.&nbsp;<\/p>\n\n\n\n<p>Typically, it is used to access &amp; write content inside XHTML elements. Following is a code to make you understand better.<\/p>\n\n\n\n<br>\n\n\n\n<pre title=\"\" class=\"wp-block-code\"><code lang=\"javascript\" class=\"language-javascript line-numbers\">Var myContentHolder = document.getElementById(\u201cabc\u201d);\nmyContentHolder.innerHTML = \u201c&lt;p> These are the most essential DOM methods in JavaScript&lt;\/p>\u201d;<\/code><\/pre>\n\n\n\n<br>\n\n\n\n<p>Now, the element on the page with id name \u201cabc\u201d will have the following content between its tags i.e., \u201cThese are the essential DOM methods in JavaScript.\u201d Using innerHTML, we can read or append text directly without messy texts.&nbsp;<\/p>\n\n\n\n<br>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion:<\/h3>\n\n\n\n<p>These were Top 10 essential JS DOM methods a programmer should know. I have tried to cover a maximum of them with examples &amp; simple explanation. And, the examples were pretty simple &amp; easy to comprehend.<\/p>\n\n\n\n<p>Whether you are a beginner or intermediate coder, these methods are powerful &amp; useful. Even though there are libraries &amp; platforms which do the needful behind the scenes, you should know these methods.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a programmer, whether you are working on a project or building a script from scratch, there are few DOM methods every programmer should know. However, tools like MooTools or jQuery might perform these methods without any user interference (behind the scenes).&nbsp;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1621],"tags":[],"class_list":["post-1427","post","type-post","status-publish","format-standard","hentry","category-programming"],"yoast_head":"<title>Top 10 JavaScript Methods for DOM Access and Manipulation<\/title>\n<meta name=\"description\" content=\"View and Share Dynamic Web Training Blog Archives. This is a great source of articles and posts on Computer and IT training, tutorials and insights\" \/>\n<meta name=\"robots\" content=\"index, follow\" \/>\n<meta name=\"googlebot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta name=\"bingbot\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Top 10 JavaScript Methods for DOM Access and Manipulation\" \/>\n<meta property=\"og:description\" content=\"Learn about the Document Object Model, an interface that allows JavaScript to dynamically manipulate an HTML document&#039;s content, structure and style.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods\" \/>\n<meta property=\"og:site_name\" content=\"Dynamic Web Training Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DynamicWebTraining\/\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/DynamicWebTraining\/\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-19T21:32:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-06T00:34:34+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2019\/12\/Top-10-Essential-JavaScript-DOM-methods-Feature-1024x536.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary\" \/>\n<meta name=\"twitter:creator\" content=\"@dynamicwebtrain\" \/>\n<meta name=\"twitter:site\" content=\"@dynamicwebtrain\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#organization\",\"name\":\"Dynamic Web Training\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/\",\"sameAs\":[\"https:\/\/www.facebook.com\/DynamicWebTraining\/\",\"https:\/\/www.linkedin.com\/company\/dynamic-web-training\",\"https:\/\/twitter.com\/dynamicwebtrain\"],\"logo\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#logo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2016\/02\/logo.png\",\"width\":361,\"height\":109,\"caption\":\"Dynamic Web Training\"},\"image\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#logo\"}},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#website\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/\",\"name\":\"Dynamic Web Training Blog\",\"description\":\"The Ultimate Training Experience.\",\"publisher\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods#primaryimage\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-content\/uploads\/2019\/12\/Top-10-Essential-JavaScript-DOM-methods-Feature.jpg\",\"width\":1200,\"height\":628},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods#webpage\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods\",\"name\":\"Top 10 JavaScript Methods for DOM Access and Manipulation\",\"isPartOf\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods#primaryimage\"},\"datePublished\":\"2019-12-19T21:32:58+00:00\",\"dateModified\":\"2025-01-06T00:34:34+00:00\",\"description\":\"Learn about the Document Object Model, an interface that allows JavaScript to dynamically manipulate an HTML document's content, structure and style.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\",\"name\":\"Training Blog\"}},{\"@type\":\"ListItem\",\"position\":2,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/category\/programming\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/category\/programming\",\"name\":\"Programming\"}},{\"@type\":\"ListItem\",\"position\":3,\"item\":{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods\",\"url\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods\",\"name\":\"Top 10 Essential JavaScript DOM methods List\"}}]},{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods#webpage\"},\"author\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#\/schema\/person\/c94653aed4a6decc8e357af0a1082233\"},\"headline\":\"Top 10 Essential JavaScript DOM methods List\",\"datePublished\":\"2019-12-19T21:32:58+00:00\",\"dateModified\":\"2025-01-06T00:34:34+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods#webpage\"},\"publisher\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/javascript-dom-methods#primaryimage\"},\"articleSection\":\"Programming\",\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#\/schema\/person\/c94653aed4a6decc8e357af0a1082233\",\"name\":\"Dynamic Web Training\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\/\/www.dynamicwebtraining.com.au\/blog\/#personlogo\",\"inLanguage\":\"en-US\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0a14e92e62ad4eee0843f5cf7da3a00e1df4c9763922d4d20ba3ed2402a6896d?s=96&d=mm&r=g\",\"caption\":\"Dynamic Web Training\"},\"description\":\"Dynamic Web Training is Australia's leading provider of instructor led software training. We offer training courses in Adobe, Web Design, Graphic Design, Photoshop, InDesign, Dreamweaver and many more.\",\"sameAs\":[\"https:\/\/www.facebook.com\/DynamicWebTraining\/\",\"https:\/\/www.linkedin.com\/company\/dynamic-web-training\",\"https:\/\/twitter.com\/dynamicwebtrain\"]}]}<\/script>","_links":{"self":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts\/1427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/comments?post=1427"}],"version-history":[{"count":14,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts\/1427\/revisions"}],"predecessor-version":[{"id":2034,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/posts\/1427\/revisions\/2034"}],"wp:attachment":[{"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/media?parent=1427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/categories?post=1427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dynamicwebtraining.com.au\/blog\/wp-json\/wp\/v2\/tags?post=1427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}