JSFiddle - React, Tailwind, and code Playground
HTML
<a id="add" href="#">Add a new list item</a>
<ul id="list">
<li>Lorem ipsum</li>
</ul>
JavaScript
var list = $('list'), addNew = $('add');
list.addEvents({
// delegate the event using e:relay(selector)
'mouseover:relay(li)': function(){
this.highlight();
}
});
addNew.addEvents({
'click': function(){
new Element('li', {
'text': 'Lorem ipsum'
}).inject(list);
}
});