RSS2.0

I moved to Debiprasad.net. Now I am blogging there, so please visit Debiprasad.net and keep me reading. love, Debiprasad

Ask questions related to online shopping in India

Where to buy online in India?

wheretobuyonline.in

document.bgColor is deprecated : How to change the background color of any web page using JavaScript

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

document.bgColor is deprecated : How to change the background color of any web page using JavaScriptSocialTwist Tell-a-Friend TwitThis Reading: document.bgColor is deprecated : How to change the background color of any web page using JavaScriptPost Link to Twitter

0 comments:

My Shared Items in Google Reader

My Blogroll

Followers

Want to see/show anything here? Contact me :)