I have a canvas in HTML and I am trying to put a transparent background so I can layer other elements under it. This is the advised code to enable a transparent background on a canvas.
const canvas = document.getElementsByTagName('canvas');
document.body.appendChild(canvas);
const ctx = canvas.getContext("2d");
<canvas style="width: 1500px; height: 800px;"></canvas>
Error message: Uncaught TypeError: Failed to execute 'appendChild' on 'Node': parameter 1 is not of type 'Node'.