Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing button background color with VB 1

Status
Not open for further replies.

Sneapy

Technical User
Nov 1, 2012
14
0
0
GB
Hey, i know im asking alot of questions hehe! but yano thats what you lovely people are here for ;)

Can you just tell me how do i change a buttons background color on click on that button, i have working code to change the documents background colour on click but cant figure it out for the buttons... :S

following is the code what i think it is
Code:
<html>
    <input id="btn1" type="button" value="Click" />

    </html>

    <script language=vbscript>
    
    sub btn1_onclick()
        btn1.bgcolor="red"
        end sub
    
    
    </script>

for the background of a document im sure you know is you just change
Code:
btn1.bgcolor="red"
to
Code:
document.bgcolor="red"

so can someone please just tell me how the heck i do it haha! :p ty who ever helps me gets helpy points :D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top