First, I am not sure whether this was a typo or not, but you put:
document.get**Element**ByClassName('floater').innerHTML = " ";
The command is actually:
document.get**Elements**ByClassName();
notice elements is plural.
Now, this doesn't behave the same as getElementById. It returns a nodelist, or in other words a list of all the elements with the specified class.
You can store the results in an array like so:
var array_name = document.getElementsByClassName('floater');
and then loop through the results to perform your actions:
for ( var i=0, var len=array_name.length; i<len; ++i ){
array_name[i].innerHtml = 'text';
}
I have not tested the code that I wrote out here, but the method is tried and true.
[edit]
I forgot to mention that this function is not supported by IE, and you can accomplish this using jQuery by doing something like: $('floater').html('text'); and it is cross-browser. You can also search the web for something that emulates the behavior of getElementsByClassName and works in all browsers.
Here is an article with a better function that emulates getElementsByClassName:
http://www.webmuse.co.uk/blog/custom-getelementsbyclassname-function-for-all-browsers/
document.getElementsByClassName = function( classname ) {
var elArray = [];
var tmp = document.getElementsByTagName("*");
var regex = new RegExp("(^|\s)" + classname + "(\s|$)");
for ( var i = 0; i < tmp.length; i++ ) {
if ( regex.test(tmp[i].className) ) {
elArray.push(tmp[i]);
}
}
return elArray;
;
This works very well, is cross browser compatible, and is used the same way as getElementsByClassName.
usage example from the article:
var el = document.getElementsByClassName("para");
for ( var i = 0; i < el.length; i++ ) {
el[i].style.color = "red";
}