using .attr() with class works like jQuery