Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Return a DOM element with tag name |elem| and attributes |attrs|. */
- function DOM(elem, attrs) {
- var elem = document.createElement(elem);
- for (var attr in attrs) {
- elem[attr] = attrs[attr];
- }
- return elem;
- }
- // use like:
- root = DOM('a', {href:page.url,
- title:page.title});
- var input = DOM('input', {type:'text',
- className:'hint',
- value:url.short_name});
Add Comment
Please, Sign In to add comment