Is there a difference between using setAttribute
to change styles and directly setting the style property?
object.setAttribute("style","background-color:#FFFFFF");
is equivalent to
object.style.backgroundColor = "#FFFFFF";
Which method is more efficient or preferable to use in web development?