Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] [OT] Looking for Javascript 3-toggle button
- Date: Fri, 12 Feb 2010 15:47:00 +0000
- From: Godwin Stewart <gstewart@example.com>
- Subject: Re: [tlug] [OT] Looking for Javascript 3-toggle button
- References: <4B75727C.50501@example.com>
On Sat, 13 Feb 2010 00:23:40 +0900, Dave M G <dave@example.com> wrote: > I think I must be using the wrong terminology, because I can't believe > this wheel has not been invented before. It is pretty trivial, which is probably why nobody's thought it worthwhile making a souped up project of it. This off the top of my head: <script language="javascript" type="text/javascript"> <!-- var colors = new Array("#ffff00","#ff0000","#00ff00"); function buttonClicked(buttonid) { var newcolor = colors.shift(); colors.push(newcolor); var ctrl = document,getElementById(buttonid); button.styles.backgroundColor = newcolor; } // --> </script> Then, elsewhere in your HTML: <input type="button" id="threestate" class="whatever" onclick="buttonclicked('threestate')" style="background-color: #00ff00;" value="whatever" /> -- G. Stewart - gstewart@example.com It's always a long day; 86400 doesn't fit into a short.Attachment: pgpWSczt7PYkM.pgp
Description: PGP signature
- Follow-Ups:
- Re: [tlug] [OT] Looking for Javascript 3-toggle button
- From: Dave M G
- References:
- [tlug] [OT] Looking for Javascript 3-toggle button
- From: Dave M G
Home | Main Index | Thread Index
- Prev by Date: [tlug] [OT] Looking for Javascript 3-toggle button
- Next by Date: [tlug] [OT][notice]A concert which conducted by the real brother(looks almost him) of the late reiji, NAKASHIMA
- Previous by thread: [tlug] [OT] Looking for Javascript 3-toggle button
- Next by thread: Re: [tlug] [OT] Looking for Javascript 3-toggle button
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links