Joined December 2011
·
Achievements
32 Karma
0 Total ProTip Views
Honey Badger
Have at least one original Node.js-specific repo
Charity
Fork and commit to someone's open source project in need
Komodo Dragon
Have at least one original repo where Java is the dominant language
"There is nothing wrong with the above methods". I'd really say any string concatenation should probably be avoided since (if the class name is influenced by some external input) it can lead to an XSS vulnerability.
http://jsbin.com/akuPUCa/2/edit?html,js,output