---
id: 587d7fa7367417b2b2512bc7
title: Change Styles Based on Data
required:
- src: 'https://cdnjs.cloudflare.com/ajax/libs/d3/4.3.0/d3.min.js'
challengeType: 6
videoUrl: ''
localeTitle: ''
---
## Description
undefined
## Instructions
undefined
## Tests
```yml
tests:
- text: ''
testString: 'assert($("h2").eq(0).css("color") == "rgb(255, 0, 0)", "The first h2
should have a color
of red.");'
- text: ''
testString: 'assert($("h2").eq(1).css("color") == "rgb(0, 128, 0)", "The second h2
should have a color
of green.");'
- text: ''
testString: 'assert($("h2").eq(2).css("color") == "rgb(0, 128, 0)", "The third h2
should have a color
of green.");'
- text: ''
testString: 'assert($("h2").eq(3).css("color") == "rgb(255, 0, 0)", "The fourth h2
should have a color
of red.");'
- text: ''
testString: 'assert($("h2").eq(4).css("color") == "rgb(0, 128, 0)", "The fifth h2
should have a color
of green.");'
- text: ''
testString: 'assert($("h2").eq(5).css("color") == "rgb(255, 0, 0)", "The sixth h2
should have a color
of red.");'
- text: ''
testString: 'assert($("h2").eq(6).css("color") == "rgb(0, 128, 0)", "The seventh h2
should have a color
of green.");'
- text: ''
testString: 'assert($("h2").eq(7).css("color") == "rgb(255, 0, 0)", "The eighth h2
should have a color
of red.");'
- text: ''
testString: 'assert($("h2").eq(8).css("color") == "rgb(255, 0, 0)", "The ninth h2
should have a color
of red.");'
```
## Challenge Seed
## Solution
```js
// solution required
```