Created
June 16, 2019 02:19
-
-
Save jeanmachuca/a0e839f4a5d3ea013cb3a339b8f6c729 to your computer and use it in GitHub Desktop.
Append a new Canvas to Body using QCObjects
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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