471,855 Members | 1,396 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,855 software developers and data experts.

Hi, I want to change the backcolor of my button every second , can somebody help me?

Hi, I want to change the backcolor of my button every second ,for example red, after a second blue, after a second re, then blue and so on...i need it in a web form not in a windows form(in winform there is a timer.tick, there it works, but in the asp.net there is a timer.elapse, and it doesn't workd , don't know why, so i was told that javascripters could help me) can somebody help me please?(javascript/c#)
Nov 5 '07 #1
3 1513
16,027 Expert Mod 8TB
You can use setInterval for this. 1 second would be 1000 milliseconds.
Nov 5 '07 #2
ok, but i'm new to javascript so can you please write some code sample which includes the color changing and interval setting?(i don't know the syntax at all...)
i'll be gratefull.:-)
Nov 5 '07 #3
5,390 Expert Mod 4TB
hi ...

the syntax is as follows:

Expand|Select|Wrap|Line Numbers
  1. var interval = window.setInterval(func_ref, milliseconds);
have a look at the link that acoder posted, it shows you almost everything you need, make an attempt and post back in case you encounter problems with your code ...

kind regards
Nov 5 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

12 posts views Thread by Rudy | last post: by
3 posts views Thread by rn5a | last post: by
4 posts views Thread by Dean Slindee | last post: by
reply views Thread by NeoPa | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by aboka | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.