I have an element that already has a class:
In YUI, if you include yuidom, you can use
YAHOO.util.Dom.addClass('div1','className');
HTH