## Incrementing Variable

To increment a variable, set the variable equal to itself plus the amount to increment by. Example of incrementing a variable called age by 1:
```age = age + 1
```

### Exercise 1 of 6

Increase money by 1 when the button is clicked.

HTML

```<button id="moneyButton">Increase money by 1</button>
<p id="moneyParagraph">Money: \$0</p>
```

JavaScript

```let moneyButton = document.getElementById(`moneyButton`)
let moneyParagraph = document.getElementById(`moneyParagraph`)

let money = 0

function increaseMoney() {
// your code will appear here
moneyParagraph.innerHTML = `Money: \$\${money}`
}
```

Money: \$0

### Exercise 2 of 6

Increase score by 2 when the button is clicked.

HTML

```<button id="scoreButton">Increase score by 2</button>
<p id="scoreParagraph">Score: 0</p>
```

JavaScript

```let scoreButton = document.getElementById(`scoreButton`)
let scoreParagraph = document.getElementById(`scoreParagraph`)

let score = 0

function increaseScore() {
// your code will appear here
scoreParagraph.innerHTML = `Score: \${score}`
}
```

Score: 0

### Exercise 3 of 6

Decrease points by 1 when the button is clicked.

HTML

```<button id="pointsButton">Decrease points by 1</button>
<p id="pointsParagraph">Points: 0</p>
```

JavaScript

```let pointsButton = document.getElementById(`pointsButton`)
let pointsParagraph = document.getElementById(`pointsParagraph`)

let points = 0

function decreasePoints() {
// your code will appear here
pointsParagraph.innerHTML = `Points: \${points}`
}
```

Points: 0

### Exercise 4 of 6

Increase width by 10 when the button is clicked.

HTML

```<button id="increaseWidthButton">Increase width by 10</button>
```

JavaScript

```let increaseWidthButton = document.getElementById(`increaseWidthButton`)

let width = 200

function increaseWidth() {
// your code will appear here
increaseWidthButton.style.width = `\${width}px`
}
```

### Exercise 5 of 6

Decrease opacity by 10 when the button is clicked.

HTML

```<button id="decreaseOpacityButton">Decrease opacity by 10</button>
```

JavaScript

```let decreaseOpacityButton = document.getElementById(`decreaseOpacityButton`)

let opacity = 100

function decreaseOpacity() {
// your code will appear here
decreaseOpacityButton.style.opacity = `\${opacity}%`
}
```

### Exercise 6 of 6

Double the number when the button is clicked.

HTML

```<button id="numberButton">Double the number</button>
<p id="numberParagraph">Number: 1</p>
```

JavaScript

```let numberButton = document.getElementById(`numberButton`)
let numberParagraph = document.getElementById(`numberParagraph`)

let number = 1

function doubleNumber() {
// your code will appear here
numberParagraph.innerHTML = `Number: \${number}`
}
```