Reputation: 109
I know it's possible to change the background image for body
or div
tags, but is it possible to add or change the background image for the html
tag?
I tried the following, but it didn't work:
$("html").css('background', 'url(../images/myImage.jpg)');
Is there another way?
Upvotes: 0
Views: 104
Reputation: 293
This method is perfec
var id_of_div ="contenedor";
document.getElementById(id_of_div).style.backgroundImage='http://conectica.com.mx/wp-content/uploads/2013/08/youtube-ios.png';
that's all
Upvotes: 0
Reputation:
Try $('body').parent().css('background', 'url(imagePath)')
. It should work.
Upvotes: 1