javascript - document.body.style.height = "100%"; -


this question has answer here:

i want handle on html tag change background image i'm running into: "typeerror: document.html undefined" error.

my code:

    function init(){         document.html.style.background ="url('175541_dsc_0291.jpg') no-repeat center center";      }      window.onload = function(){         init();     } 

i lurked around similar questions, closest found using body tag instead. works when change html object body.

additionally, can set html background want in css file, want javascript. ideas what's going on?

thanks in advance, george

to access html tag, use::

document.documentelement 

Comments