HTML - Fragment


A fragment in HTML is a piece of HTML that is intended to be added dynamically into an web page.


  • The fragment (You could have get it from an AJAX call)
let fragment = '<p>My fragment !</p>'
document.body.insertAdjacentHTML('afterend', fragment);
  • Result:

HTML template

HTML has a template functionality that can be used to manage fragment.

Powered by ComboStrap