T.J. Crowder beat me to it, but just as a demo, if you were hellbent on using setAttribute
, you could do so like this:
document.getElementById("pic1").setAttribute("style","background-color:red");
As you see, the css attribute is background-color, not the html attribute.