constructor()
an instance of custom element is created or upgraded.
connectedCallback()
custom element is appended into/moved in a document.
disconnectedCallback()
custom element is removed from the document.
attributeChangedCallback(attrName, oldVal, newVal)
one of the custom element’s attributes is added/removed/changed.
observed attributes are specified with static get observedAttributes().
adoptedCallback()
custom element is moved to a new document.
<divid="parent"><!-- web component --> <my-componenttext="my personal text"></my-component></div><buttonid="button"onclick="removeElement()">Remove Element</button>