diff --git a/boot/boot.js b/boot/boot.js index d52ae9d7d..954071c2f 100644 --- a/boot/boot.js +++ b/boot/boot.js @@ -114,6 +114,7 @@ children: array of further child nodes innerHTML: optional HTML for element class: class name(s) document: defaults to current document +eventListeners: array of event listeners (this option won't work until $tw.utils.addEventListeners() has been loaded) */ $tw.utils.domMaker = function(tag,options) { var doc = options.document || document; @@ -133,6 +134,9 @@ $tw.utils.domMaker = function(tag,options) { $tw.utils.each(options.attributes,function(attribute,name) { element.setAttribute(name,attribute); }); + if(options.eventListeners) { + $tw.utils.addEventListeners(element,options.eventListeners); + } return element; };