Amir Salihefendic has taken the idea from MochiKit and developed a standard alone 2k DOM library called Magic DOM.
Instead of writing:
JAVASCRIPT:
-
-
var dl = document.createElement(’dl’);
-
dl.className = ‘my_dl’;
-
var dt_equ = document.createElement(’dt’);
-
dt_equ.innerHTML = ‘Equipments’;
-
dt_equ.className = ‘my_dt’;
-
dl.appendChild(dt_equ);
-
you would do:
JAVASCRIPT:
-
-
var dl = DL({’class’: ‘my_dl’},
-
var dt_equ = DT({’class’: ‘my_dt’}, ‘Equipments’));
-
Download MagicDOM for more info.
Source: Ajaxian
Original Article: http://feeds.feedburner.com/~r/ajaxian/~3/126991513/magic-dom