JavaScript How do I change a button state until another button is pressed? change button state swift,change button state tkinter,change button

I have a button that has a drawable XML file set as the background, this is so that when the button is pressed the background colour and outline of the button is change. However it does not stay like this, after a second it goes back to what it is before. How do I get it to stay with the changed colours until a different button is pressed?

<item android:state_pressed="true" >
    <shape>
        <solid
            android:color="#99000000" />
        <stroke
            android:width="1dp"
            android:color="#489d73" />
    </shape>
</item>
<item>
    <shape>
        <gradient
            android:startColor="#66000000"
            android:endColor="#66000000"
            android:angle="270" />

    </shape>
</item>
Answer:1

Create background drawables for each button state. Then when clicking another button change view's background programmatically.

Answer:2

If you want the button to keep its color until you change it, you have to change its background programatically.

Answer:3

when I run npm from terminal I get this error and nothing else. no npm command is working, all of them are giving the same error and I can't even install programs that are depending on nodejs. $ ...

when I run npm from terminal I get this error and nothing else. no npm command is working, all of them are giving the same error and I can't even install programs that are depending on nodejs. $ ...

I'm quite new to Angular and I've discovered that there's something like Renderer2, ViewChild and ElementRef for the sake of handling DOM rather than accessing it directly. And the articles I've come ...

I'm quite new to Angular and I've discovered that there's something like Renderer2, ViewChild and ElementRef for the sake of handling DOM rather than accessing it directly. And the articles I've come ...

I'm learning React. It seems to me that HOC like the following example from React's official docs: function withSubscription(WrappedComponent, selectData) { // ...and returns another component... ...

I'm learning React. It seems to me that HOC like the following example from React's official docs: function withSubscription(WrappedComponent, selectData) { // ...and returns another component... ...

I am trying to create a typing effect using Vanilla JS, but for some reason the charAt function isn't working, and when I replace i with something like 0, it works, but it spits it all out at once ...

I am trying to create a typing effect using Vanilla JS, but for some reason the charAt function isn't working, and when I replace i with something like 0, it works, but it spits it all out at once ...

  1. isn't
  2. https://www.instagram.com/
  3. isnetworld
  4. instagram
  5. isn't she lovely
  6. isnt it romantic
  7. isna
  8. isn't it ironic
  9. isner
  10. isnull sql
  11. isn network
  12. isnac 2020
  13. isnt she lovely chords
  14. isns
  15. isnan
  16. isn't it
  17. isnull
  18. isn't it romantic cast
  19. isna excel
  20. disney plus