getAttribute is needed here because svg elements return a special objects for className property and not a string.