Skip to content

Instantly share code, notes, and snippets.

@jeanmachuca
Created June 16, 2019 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeanmachuca/a0e839f4a5d3ea013cb3a339b8f6c729 to your computer and use it in GitHub Desktop.
Save jeanmachuca/a0e839f4a5d3ea013cb3a339b8f6c729 to your computer and use it in GitHub Desktop.
Append a new Canvas to Body using QCObjects
// This will create a QCObjects class named "canvas" extending a HTMLCanvasElement with a customAttr property that has a "custom" value
Class('canvas',HTMLCanvasElement,{
customAttr:'custom'
});
// This will declare an instance canvas1 from the class canvas
let canvas1 = New(canvas,{
width:100,
height:100,
});
// This will append the canvas1 object to the document body
document.body.append(canvas1);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment