Warning: file_put_contents(): Only 0 of 56005 bytes written, possibly out of free disk space in /var/www/html/cach3.com/read_page_simple.php on line 79
W3.JS Includes

W3.JS HTML Includes

Learn XML DOM  Learn JSON  Learn W3.JS  Web Templates  Web Development  Learn XML DOM  W3.JS Reference  HTML Exercises  CSS Exercises  JavaScript Exercises 

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:

HTML includes are done by JavaScript.

Make sure your page has w3.js loaded and call w3.includeHTML():

You can include any number of HTML snippets:

Try it Yourself » With CSS »

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.

HTML
CSS
JavaScript
SQL
Python
PHP
jQuery
Bootstrap
XML

Your message has been sent to W3Schools.

colorpicker

W3Schools.com