
<html> <body> <script type="text/javascript"> document.body.bgColor="lavender"; </script> </body> </html>
<html>
<body>
<p id="p1">Hello World!</p>
<script type="text/javascript">
document.getElementById("p1").innerHTML="New text!";
</script>
</body>
</html>
<html> <body> <input type="button" onclick="document.body.bgColor='lavender';" value="Change background color" /> </body> </html>
<html>
<head>
<script type="text/javascript">
function ChangeText()
{
document.getElementById("p1").innerHTML="New text!";
}
</script>
</head>
<body>
<p id="p1">Hello world!</p>
<input type="button" onclick="ChangeText()" value="Change text" />
</body>
</html>
Text changed here!
<html>
<head>
<script type="text/javascript">
function ChangeBackground()
{
document.body.style.backgroundColor="lavender";
}
</script>
</head>
<body>
<input type="button" onclick="ChangeBackground()"
value="Change background color" />
</body>
</html>
<html>
<head>
<script type="text/javascript">
function ChangeStyle()
{
document.getElementById("p1").style.color="blue";
document.getElementById("p1").style.fontFamily="Arial";
document.getElementById("p1").style.fontSize="larger";
}
</script>
</head>
<body>
<p id="p1">Welcome Leakbali.com Visitors!</p>
<input type="button" onclick="ChangeStyle()" value="Change style" />
</body>
</html>
Welcome Leakbali.com Visitors!