Skip to content

Instantly share code, notes, and snippets.

@caubry
Last active January 3, 2016 09:58
Show Gist options
  • Save caubry/8445891 to your computer and use it in GitHub Desktop.
Save caubry/8445891 to your computer and use it in GitHub Desktop.
var manipulateDOM = function() {
var body=document.getElementById("body");
var div=document.createElement("div");
if(div){
div.id = "gameContent";
var canvas=document.createElement("canvas");
canvas.id = "gameCanvas";
try {
body.appendChild(div);
div.appendChild(canvas);
} catch (e){
document.write(e);
}
}
};
manipulateDOM();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment