Skip to content

Instantly share code, notes, and snippets.

@jeethu
Created April 13, 2009 15:50
Show Gist options
  • Save jeethu/94499 to your computer and use it in GitHub Desktop.
Save jeethu/94499 to your computer and use it in GitHub Desktop.
DOMBuilder example
var Event = YAHOO.util.Event, DOM = YAHOO.util.Dom, DB = YAHOO.tagz.DomBuilder;
Event.onDOMReady(function() {
Event.on('id_ok','click',function(e) {
var s = YAHOO.lang.trim(DOM.get('id_name').value);
if(s) {
DOM.insertBefore(
DB.DIV({style:{margin:'2px'}},
DB.SPAN(
{style:{color:'white','background-color':'#aa0011',padding:'2px'}},
'You entered: '+s)),
DOM.getFirstChild(document.body));
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment