News for hackers. Stuff that matters.
Re:Hello Backbone.js - A step-by-step tutorial by shaunxcode on Tuesday June 07, 2011 @11:58PM (#2631968)
I have a class called Tag with static methods for all relevant tag names which merely wraps $('<' + tagname + '/>') and thus allow for stuff like:

   Tag.ul(
       Tag.li('unclickable li tag')
           .addClass('unclickable'),
       Tag.li('test clickable li tag')
           .addClass('clickable')
           .click(function() {
               alert('clicked on test')}))
I prefer this as it keeps my view code "in language" and makes it easy to apply any sort of jquery methods which I need to the different elements.

There are no comments on this comment yet.