Add method to add listener to el.
@@ -892,6 +892,12 @@ impl<Ms> El<Ms> {
self
}
+ /// Add a new listener
+ pub fn add_listener(mut self, listener: Listener<Ms>) -> Self {
+ self.listeners.push(listener);
+ self
+ }
+
/// Add a text node to the element. (ie between the HTML tags).
pub fn add_text(mut self, text: &str) -> Self {
// todo: Allow text to be impl ToString?
