Entries by Ville

Document.getElementsByName()

JavaScript’s Document.getElementsByName() method returns a live NodeList containing all the elements whose name attribute matches the specified string.

Document.getElementsByClassName()

JavaScript’s Document.getElementsByClassName() method returns a live array-like object containing all the elements that have all the specified class names.

Document.getElementById()

JavaScript’s Document.getElementById() method returns the element whose id attribute matches the specified string or null if no id attribute matches the string.

Document.querySelectorAll()

JavaScript’s Document.querySelectorAll() method returns a non-live NodeList containing all the elements that match any of the specified CSS selectors.

Document.querySelector()

JavaScript’s Document.querySelector() method returns the first element that matches any of the specified CSS selectors or null if no element matches the selectors.

Document.prepend()

JavaScript’s Document.prepend() method inserts a set of Node or string objects before the first child of the Document.

Document.append()

JavaScript’s Document.append() method inserts a set of Node or string objects after the last child of the Document.