.children is an HTMLCollection which is an array-like object. You can access its elements with bracket syntax [] and loop over it with for loops.
Changing Content
textContent
innerHTML
.innerHTML will turn the HTML tags in the string into DOM elements.
Manipulating Styles
NOTE: Hyphenated CSS property names are in the style object as camelCase.
Manipulating CSS Classes
classlist.add
classlist.remove
classlist.toggle
Instead of adding styles to the style object directly, you can write the style rules in a css file under a class name that you will then apply to the element in the DOM.
Add classes
Remove classes
Toggle classes
If the element already has the selected class, .toggle will remove it, otherwise it will be added.
Add And Remove Multiple Classes
Manipulating Attributes
In most cases you can just use the DOM element's corresponding property. Read more here for when property and attribute are synced.
You can change these values using the assigment operator =:
Data Attributes
Creating New Elements
document.createElement
Inserting Elements
append
prepend
after
before
.append
Adds elements to the end of the parent element's list of children.
.prepend
Adds elements to the beginning of the parent element's list of children.
.after
Adds elements as siblings after the element its called on.
.before
Adds elements as siblings before the element its called on.