How do I change the color of the button after a button is pressed in html.

To change the color of a button after it is pressed in HTML, you will need to use JavaScript along with CSS. Here's an example of how you can achieve this:

1. First, create a button element in your HTML markup:
```html
<button id="myButton">Press me!</button>
```

2. Add some CSS to define the initial and pressed states of the button:
```css
#myButton {
background-color: blue; /* Initial background color */
}

#myButton:active {
background-color: red; /* Background color when the button is pressed */
}
```
In this example, the button is initially blue, and when it is pressed or clicked by a user, it will turn red.

3. To make the button change color dynamically using JavaScript, you can use an event listener. Add the following script to the `<head>` or before the closing `</body>` tag:

```html
<script>
var button = document.getElementById('myButton');

button.addEventListener('click', function() {
button.style.backgroundColor = 'green'; /* Change background color on click */
});
</script>
```
In this script, we select the button by its ID using `document.getElementById()`. Then, we attach an event listener to it using `addEventListener()` with the `'click'` event. When the button is clicked, the event handler function is executed, which changes the background color of the button to green using `style.backgroundColor` property.

Now, when the button is pressed, its background color will change to green using JavaScript.

This is a basic example, and you can modify the CSS and JavaScript code to suit your specific needs.