views:

116

answers:

2

I have a span like this

    <span class='class_name'> blah blah </span>

I want to select the class name of this span. for that iam using this.className its working fine in firefox. but for explorer its not...

How can i fix that??

A: 

That should be working in Explorer too. You could try, though:

$(this).attr('class');
Paolo Bergantino
why almost every JS-related question assume jQuery is included? :-/
Maciej Łebkowski
Because he put a tag of "jquery"?
Paolo Bergantino
+2  A: 

Is the variable this pointing to the same node in IE and Firefox? You could verify that by putting an alert(this.tagName) or alert(this.id).

Darin Dimitrov