frenchie
frenchie

Reputation: 51927

converting jquery to pure javascript

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

Answers (1)

LoveAndCoding
LoveAndCoding

Reputation: 7947

document.body.style.backgroundImage = 'url('+Canvas.toDataURL('image/png')+')';

Upvotes: 6

Related Questions