Sunday, 7 September 2014

DHTML color change

<html>
<head>
<title>welcome</title>
<script>
function abc()
{
document.getElementById("check").align="center";
}
function abc1()
{
document.getElementById("check").align="right";
}

function abc2()
{
document.getElementById("check").align="left";
}

function abc3()
{
document.getElementById("check1").color="red";
}
function abc4()
{
document.getElementById("check1").color="green";
}

function abc5()
{
document.getElementById("check1").color="blue";
}
</script>
</head>
<body>
<p id="check"><font id="check1">we are programer..
we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer..we are programer.. </font></p>
<button onClick="abc2()">Left</button>
<button onClick="abc()">Center</button>
<button onClick="abc1()">Right</button>

<button onClick="abc3()">Red</button>
<button onClick="abc5()">Blue</button>
<button onClick="abc4()">Green</button>
</body>
</html>

No comments:

Post a Comment