Consider a simple JS event of
document.getElementsByClassName(\'test\')[0].onclick=function(){
document.getElementsByClassName(\'test\')[0].innerHTML = \'New
Just use this inside the function. this will be the element on which the event is being fired.
(function() {
var elms = document.getElementsByClassName("test"),
l = elms.length, i;
for( i=0; i
It's a bit more complicated than jQuery's:
$(".test").click(function() {
$(this).html("New Text");
});
But it'll be significantly faster without the bloat that jQuery adds ;)