Insert HTML at Specified Positions3:39 with Guil Hernandez
InsertAdjacentHTML method to insert elements into the DOM. This method provides more control over inserting HTML inside a parent. You pass it the HTML and text content to create as a string, and then that string gets parsed and inserted into the DOM at the position you specify.
insertAdjacentHTML() accepts one of the following strings representing the position relative to an element:
'beforebegin': Before the
'afterbegin': Just inside the
element, before its first child.
'beforeend': Just inside the
element, after its last child.
'afterend': After the
You need to sign up for Treehouse in order to download course files.Sign up