- Back to Home »
- javascript »
- Change background color using javascript
Posted by : food
Wednesday, 1 May 2013
Change background color using javascript . It is very easy and simple coding.
Simply write this code in to Text Editor(Notepad) and SAVE the document as .html extension.And change the background color of your document. It is very helpful for Website.
<html>
<head>
<script language="javascript">
function bgclr()
{
document.bgColor=f1.t1.value;
}
</script>
</head>
<body>
<form name="f1">
Color : <input type="text" name="t1" onkeyup="bgclr()">
</form>
</body>
Like This :