.appendChild is not working for me, all I want to do is append the html code in my javascript const bottomText to the DOM without jQuery
const bottomText = `
<div class="bottom-text row">
<div class="column column-left">test
<p>xx%<span></span></p>
</div>
<div class="column column-right">
<p>test</p>
</div>
</div>
<hr>
`;
document.getElementById("piechart").appendChild(bottomText);
And my html
<body>
<div class="graphs">
<div class="pie-chart" id="piechart">
</div>
<script src="./js/pie.js"></script>
<script src="./js/linegraph.js"></script>
</div>
</body>
Why does it not work? with jquery it works but for this project they want me to only use vanilla js
document.getElementById('targetDivId').innerHTML += 'myHTMLString'?