Tell us what’s happening:
Describe your issue in detail here.
**Your code so far**
<body>
<script>
const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];
d3.select("body").selectAll("h2")
.data(dataset)
.enter()
.append("h2")
.text((d) => (d + " USD"))
// Add your code below this line
.style("color", (d) => {
if (d < 20) {
return 'red' ;
}
else {
return 'green' ;
}
});
// Add your code above this line
</script>
</body>
**Your browser information:**
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36
Challenge: Change Styles Based on Data
Link to the challenge:
ilenia
October 26, 2021, 10:04am
2
Hello there.
Do you have a question?
If so, please edit your post to include it in the Tell us what’s happening section.
Learning to describe problems is an important part of learning how to code.
Also, the more information you give us, the more likely we are to be able to help.
1 Like
I did exactly what it said to me. But it shows all of my steps are wrong. Please help me with that.
why it’s not working after getting the exact same results that required ?
I just copy pasted your code and it works fine and passes all the tests. Try resetting the code, disabling adblockers etc.
1 Like
thanks for the help brother but it never works on mine I tried it again and again but it never changed…
Note: Some browser extensions, such as ad-blockers and dark mode extensions can interfere with the tests. If you face issues, we recommend disabling extensions that modify the content or layout of pages, while taking the course.
Are you using any extensions that interfere with the test suite?
system
Closed
June 14, 2022, 8:07am
8
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.