Stuck on D3 exercise: Add Classes with D3

In the following D3 exercise called Add Classes with D3 I can’t get my code to pass. I type in .attr(“div”,“bar”) and I can’t pass the first test (the second test passes fine). Is this an error in the project or am I missing something?

Edit: Never mind, I solved this issue. The solution was to make it .attr(“class”,“bar”).

I am a little beginner, but from what I understand the attr method is an assignment, there is no statement that we have to pass attr (“div”, “class”) if we take only the example they give selection.attr("class", "container")
The impression that we have to replace the first parameter with a class and second with a container which confuses, without reading the explanation better, my first language is Portuguese so I missed some details.
Going back, having done all the selection on top of the div (which is a tag called container) the assignment for each div is given by attr('class', 'bar') why is basically done even though <div class = "bar">, pass an identify class by assigning the class .bar.