Change Body Backgroud Color By Textbox Using HTML

How To Change HTML Body Color By Using Textbox

Today i am going to tell you a very simple and usefull HTML TRICK, In this article we will learn how to change Body Background color by Fill Color Name in Text Box.

First Of All you have to create a html file and paste this html code….

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body onkeyup=document.bgColor=document.fname.color.value>
   <form name="fname">
      <input type="text" name="color" />
   </form>
</body>
</html>

Now Save the file and run it in your Browser and Fill The Color Name in Text Box..and see magic..

Fill Orange Color in Textbox
Fill Pink Color in Textbox

Leave a Reply

Your email address will not be published. Required fields are marked *