Tell us what’s happening:

I can’t figure out the correct answer. Any help?

Your code so far

.bar {
  width: 25px;
  height: 100px;
  display: inline-block;
  background-color: blue;
  const dataset = [12, 31, 22, 17, 25, 18, 29, 14, 9];"body").selectAll("div")
    // Add your code below this line
d3.attr("bar", "div");

    // Add your code above this line

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36.

Challenge: Add Classes with D3

Link to the challenge:

Hello there,

You almost got it.

Hint: The attr method is used the same as the append method.

Hope this helps

So please what is the correct answer?

I will not give you the answer directly, but am willing to help walk you through whatever is currently confusing you.

Think about what you did in the previous lesson:

I figured it out. Thanks

1 Like

please i didn’t get it am the beginner so you can show me the proccess

Solution found in a google search. Search about .attr()