If you always know that your class will be first, and you always know that it will have a class:
target_text = this.className.split(' ')[0]
No need to use jQuery methods when you are doing simple DOM things.
Note that the above will be an error if the element has class NO (I think className will be null). It may be safer to do
target_text = this.className && this.className.split(' ')[0]
Also, depending on what you are trying to do, you may want to reorganize your code so as not to save state in the DOM. Try to avoid storing information in the DOM, it's expensive, and the DOM is ugly.
Andy ray
source share