How can I reference the element’s corresponding DOM object?

The <html> element can be referred through the document.documentElement property. In general, the root element of any document can be referred through .documentElement.

document.documentElement.style.background = '';

Note: .style.background returns the value for background as an inline style property. That is, defined using <html style="background:..">. If you want to get the calculated style property, use getComputedStyle:

var style = window.getComputedStyle(document.documentElement);
var bgColor = style.backgroundColor;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)