Replace attr("class") by classed() when it makes code clearer