Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    button background color

    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

  • #2
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <form name=form1>
    <input type=button name=btn1 value= "test" 
    onmouseover="this.style.backgroundColor='red'"
    onmouseout="this.style.backgroundColor=''">
    </form>
    .....Willy

  • #3
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    New to the CF scene
    Join Date
    Nov 2004
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation

    i got some

    Code:
    <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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •