使用 innerHTML

HTML

<div id="app"></div>

JS

document.getElementById('app').innerHTML = '<p>Some text</p>'

現在 HTML 看起來像這樣

<div id="app">
    <p>Some text</p>
</div>