Professional Documents
Culture Documents
beforebegin
Create new elements The HTML would be placed immediately before the element, as a sibling.
afterbegin
The HTML would be placed inside the element, before its first child.
creating an HTML element
beforeend
const ourElement = document.createElement('section'); The HTML would be placed inside the element, after its last child.
afterend
creating an text node The HTML would be placed immediately after the element, as a sibling.
remove a style
Access, Add, Remove Attributes ourElement.style.removeProperty("color");
An HTML element
Access all style list applied for this element
<a id=”ourelement” href=”#hello” >Hello</a>
ourElement.style; // returns an object
Access an element
const ourElement = document.getElementById('ourelement');