var name = value;
let name = value;
const name = value;
+
, -
, *
, /
)=
, +=
, -=
, etc.)==
, ===
, !=
, !==
)&&
, ||
, ``)function functionName() { }
const functionName = function() { };
(param) => {}
let arrayName = [];
push()
, pop()
, shift()
, unshift()
, splice()
, slice()
, concat()
, join()
, reverse()
, sort()
for
loopwhile
loopdo...while
loopfor...in
loopfor...of
loopif
statementelse
statementswitch
statementstring1 + string2
`${variable} Hello World`
document.createElement(tagName)
to create a new element.parentNode.appendChild(childNode)
.element.innerHTML = "New Content"
.document.getElementById("id")
.document.getElementsByClassName("className")
.document.getElementsByTagName("tag")
.document.querySelector(selector)
or multiple elements with document.querySelectorAll(selector)
.element.addEventListener(event, function, useCapture)
.parentNode
or parentElement
.childNodes
or children
.nextSibling
or previousSibling
.parentNode.removeChild(childNode)
.element.setAttribute(name, value)
.element.getAttribute(name)
.element.style.property = value
.document.getElementsByClassName
) and static (document.querySelectorAll
) NodeLists.click
, dblclick
, mousedown
, mouseup
keydown
, keyup
, keypress
submit
, change
resize
, scroll
new Date()
toLocaleDateString()
, toLocaleTimeString()