js dom cheat sheet code example
Example 1: javascript cheat sheet
Best Cheat Sheet:
https://websitesetup.org/wp-content/uploads/2020/09/Javascript-Cheat-Sheet.pdf
Example 2: javascript cheat sheet
'https://htmlcheatsheet.com/js/'
'https://websitesetup.org/wp-content/uploads/2020/09/Javascript-Cheat-Sheet.pdf'
Example 3: javascript dom cheat sheet
document.getElementById('someid');
document.getElementsByClassName('someclass');
document.getElementsByTagName('LI');
document.querySelector('.someclass');
document.querySelectorAll('div.note, div.alert');
Example 4: javascript cheatsheet
document.getElementById("elementID").innerHTML = "Hello World!";
Example 5: dom javascript cheat sheet
var newHeading = document.createElement('h1');
var newParagraph = document.createElement('p');
var h1Text= document.createTextNode('This is a nice header text!');
var pText= document.createTextNode('This is a nice paragraph text!');
newHeading.appendChild(h1Text);
newParagraph.appendChild(pText);
Example 6: dom javascript cheat sheet
var stored = document.getElementById('someid');
var children = stored.childNodes;
var parental = children.parentNode;