Reputation: 51927
I have a function that creates an image with the canvas object. The last line of the function says this:
$('body').css({ 'background-image': "url(" + Canvas.toDataURL("image/png") + ")" });
I'm looking to convert this line into pure javascript to remove the jQuery dependency. Any suggestions?
Thanks.
Upvotes: 1
Views: 286
Reputation: 7947
document.body.style.backgroundImage = 'url('+Canvas.toDataURL('image/png')+')';
Upvotes: 6