DOM Insert Outside Elements

Listed below the DOM methods that allows to insert a data Outside the exisiting elements.

After: .after()

.after() method allows to insert or append content after the specified element.

Before: .before()

.before() method allows to insert or append content before the specified element.

Insert After: .insertAfter()

.insertAfter() is more or less similar to “after” which performs the same task of allowing to insert the content after the specified element.

Insert Before: .insertBefore()

.insertBefore() is more or less similar to “before” e which performs the same task task of allowing to insert the content before the specified element.



Ask Questions

Ask Question