By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
462,891 Members | 773 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 462,891 IT Pros & Developers. It's quick & easy.

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

P: 30
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 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
Share this Question
Share on Google+
3 Replies

Expert Mod 15k+
P: 16,027
You can use setInterval for this. 1 second would be 1000 milliseconds.
Nov 5 '07 #2

P: 30
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

Expert Mod 5K+
P: 5,390
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.