I am creating an HTML document and I want to embed an HTML snippet from a separate file (not a full HTML document) into it.
Suppose the document I want to embed into is the following:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link href="style.css" rel="stylesheet">
</head>
<body>
(stuff)
<placeholder />
</body>
</html>
and the code to embed is this:
<h1>Hello world</h1>
<p>Lorem ipsum dolor sit amet, vel lucilius consequat adolescens ut, ex
atomorum forensibus efficiendi mei. Eam adhuc regione eu, mei ex alia
posidonium. Duis dicam postea mel id. Munere dolore ut eam, eam diam
causae docendi id. At persius dolores eam, ea sea omnesque democritum,
erroribus dissentiunt pro ut.</p>
Notice that the code I want to embed is not a complete HTML document; just a snippet. How would I embed that where the placeholder is in the main file using JavaScript?