Created
April 13, 2009 15:50
-
-
Save jeethu/94499 to your computer and use it in GitHub Desktop.
DOMBuilder example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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