Include HTML within HTML using JavaScript To import an HTML file, you will use a custom tag with a src attribute that points to the source HTML. Simple example: <inc src="file.html"></inc>