Include an HTML file:
Save the HTML you want to include in an .html file:
Including HTML is done by using a w3-include-html attribute:
Make sure your page has w3.js loaded and call w3.includeHTML():
You can include any number of HTML snippets:
When you include HTML snippets in a web page, you must secure that other functions that depends on the included HTML do not execute before the HTML is properly included.
The easiest way to "hold back" code is to place it in a callback function.
A callback function can be added as an argument to w3.includeHTML():
You will find a callback example in the next chapter of this tutorial.
Your message has been sent to W3Schools.