Long time back I have posted one blog, where I have used document.bgColor to change the background color of any web page or web site. When I tried this today, it did not work. I found that document.bgColor is deprecated. It did not work in any browser. Hence I search for the solution and found this.
document.bgColor is deprecated in DOM Level 2 HTML. The recommended alternative is use of the CSS style background-color which can be accessed through the DOM with document.body.style.backgroundColor. Another alternative is document.body.bgColor, although this is also deprecated in HTML 4.01 in favor of the CSS alternative.
So, now if you want to change the background color of any web page or web site for better readability run the following code in the address bar of your browser.
javascript:document.body.style.backgroundColor='white'; void(0);
----
Reference : DOM:document.bgColor - MDC
0 comments:
Post a Comment