> change button color in javascript ~ Online tutorial

change button color in javascript

change button color in javascript

In the program we will show you How do change button color using javascript .In javascript we are using onmouseover it is used to record mouse move.


Source code




<html>
<head>
<script type="text/javascript">
function changeColor(color)
{
document.getElementById('MyButton').style.background=color;
}
</script>
</head>
<body>
<p>Move mouse over the color string</p>
<table width="60%">
<tr>
<td bgcolor='red' onmouseover="changeColor('red')">RED</td>

<td bgcolor='yellow' onmouseover="changeColor('yellow')">YELLOW</td>

<td bgcolor='aqua' onmouseover="changeColor('aqua')">AQUA</td>
</tr>
</table>
<form>
<input id="MyButton" type="button" value='changing color of buttons'>
</form>
</body>
</html>

Please Give Us Your 1 Minute In Sharing This Post!
Please Give Us Your 1 Minute In Sharing This Post!
SOCIALIZE IT →
FOLLOW US →
SHARE IT →
Powered By: BloggerYard.Com

0 comments: