Add canvas to a page with javascript
Use something like Node.appendChild( child ) for adding it to the DOM: var canv = document.createElement(‘canvas’); canv.id = ‘someId’; document.body.appendChild(canv); // adds the canvas to the body element document.getElementById(‘someBox’).appendChild(canv); // adds the canvas to #someBox Or you can use element.innerHTML: document.body.innerHTML += ‘<canvas id=”someId”></canvas>’; // the += means we add this to the inner HTML … Read more