...

View Full Version : button background color



hashim
11-08-2004, 11:20 AM
hi

how can i change the background of the button when the user move the mouse over this button?

i can change the value but i can not change the background!

code
----

<script language=javascript>
function change()
{
var Article = document.form1.btn1.value;
switch(Article)
{
case "test":
document.form1.btn1.value = "other value";

break;
}
}
</script>
<form name=form1>
<input type=button name=btn1 value= "test" onmouseover="change();">
</form>

can any one tell me

thank you

Willy Duitt
11-08-2004, 11:51 AM
<form name=form1>
<input type=button name=btn1 value= "test"
onmouseover="this.style.backgroundColor='red'"
onmouseout="this.style.backgroundColor=''">
</form>


.....Willy

hashim
11-08-2004, 12:24 PM
thank you Willy for your fast reply :)
but what if i want the background to be transerant , can i write a color code instead of color name?
what i want to change the font color

thank you in advance

ahmed hashim

hashim
11-08-2004, 01:34 PM
i got some



<form name=form1>
<input type=button name=btn2 value= "test2"
onmouseover="this.style.color = '#FF0000'"
onmouseout="this.style.color = '#FFFC00'">

</form>

this will change the forcolor of the button

onmouseover="this.style.font = 'italic small-caps bold 12pt serif'"
this will change the color

i will try to know how to make it transparent

thnx

ahmed hashim



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum