In Firefox and Internet Explorer the example above alerts
"true". It does not make sense for the hasClassName method to
return true for a space.

Also, in Internet Explorer 7, if the class attribute of an
element contains a certain non-printable white space character, and
that character is passed as an argument to hasClassName, the
hasClassName method will return true. I came across this bug in my
own development. I have an example case in my code base, however, I
can not create a simple example to demonstrate or recreate the
problem. I could not figure out exactly what non-printable white
space character caused the problem.

My solution to both problems is to check if the className
argument passed to the hasClassName method is blank. I added line 3
to the hasClassName method to perform this check:

There may be a more optimal way to check for a blank class name
argument but the code above does indeed solve the problem. It's
interesting to note that the blank method also uses a regular
expression. Another solution may be to incorporate this regular
expression in to the hasClassName method.