# Disable button AND colour change?

**URL:** https://forum.kirupa.com/t/disable-button-and-colour-change/192284
**Category:** Uncategorized
**Created:** [June 27, 2006, 2:56pm UTC](https://forum.kirupa.com/t/disable-button-and-colour-change/192284 "2006-06-27T14:56:21Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Claire\_murphy](https://avatars.discourse-cdn.com/v4/letter/c/43a26b/32.png) [@Claire\_murphy](https://forum.kirupa.com/u/Claire_murphy)
#### Post date: [June 27, 2006, 2:56pm UTC](https://forum.kirupa.com/t/disable-button-and-colour-change/192284/1 "2006-06-27T14:56:21Z")

</div>

[FONT=Courier New][FONT=Courier New]Hey[/FONT][/FONT]

[FONT=Courier New]The following code is written to disable the button that is clicked but enable it when the next is clicked. Similarly i require the same buttons to change colour. All buttons start as #170A67 and which ever is clicked changes to #9900FF until the next button is clicked. Is it possible to include that in this code?[/FONT]

[FONT=Courier New][FONT=Verdana]

```auto
function disableButtons(disableMe) {
    for (i=0; i<btnArray.length; i++){
        var btn = btnArray*;
  btn.enabled = true;
  }
 disableMe.enabled = false;
 }

```

[/FONT]

[/FONT]
