I think your code has a couple extra lines. It should be: $('.new').livequery('click', function() { $('.new').before('<li class="item' + (index+2) + '">Item ' + (index + 2) + '</li>'); return false; });
Though I'm not sure you actually need "livequery" there; I think bind would suffice.