You can’t set the float propety directly, like other properties, e.g. element.style.fontSize= "small";

One needs to use cssFloat for standard-compliant browsers, and styleFloat for Internet Explorer.

Simply set both of them. It will not cause any problems, and will work in all possible browsers.

    element.style.cssFloat = "right";
    element.style.styleFloat = "right"
;