new ng.InnerHtmlEvents (Object events) vs. 1.1.0 Full+Lite

In some cases, updating DOM using innerHTML is the fastest and most efficient way; however, managing events and binding functions is not easily achieved using innerHTML. This is why we created an innerHTML events class to handle the process and allow for binding functions to objects while creating static HTML.

Parameters

Object events Required vs. 1.1.0 Full+Lite
A JavaScript object where the keys are the events' names and the values are the events' functions.

Examples

Creating InnerHTMLEvents
Demo:

Inheritance Tree

This class inherits the following classes and all their methods and properties. It's recommended to check if any private properties/options are defined before using them. The complete list of inheritted methods and events are listed below the current object Custom Events.
ng.Events ()
ng.InnerHtmlEvents (events)

Methods

Function ng.InnerHtmlEvents.get_html () vs. 1.1.0 Full+Lite
Retrieve the HTML code for the events to be used in the innerHTML. Once the get_html() method is called, new events cannot be added to the object.
Function ng.InnerHtmlEvents.remove () vs. 1.1.0 Full+Lite
Removes the InnerHTMLEvents object and all its events methods. This function does not remove any pre-populated HTML code which might cause an error.

ng.Events () Methods

Some of these methods might be overriden by the inheriting class.
Function ng.Events.add_event (evt, func) vs. 1.1.0 Full+Lite
The add_event method will attach an event listener to an object. When the event is fired, the listeners functions will be executed on last added first run approach.
Function ng.Events.add_events (obj) vs. 1.1.0 Full+Lite
This method works the same way as Events.add_event(evt, func) except it takes an object with a list of events and functions.
Function ng.Events.remove_event (evt, func) vs. 1.1.0 Full+Lite
Remove the function func from the event evt queue. When adding the event, you should add the function by reference. Anonymous functions cannot be removed.
Function ng.Events.remove_events (obj) vs. 1.1.0 Full+Lite
This method works the same way as Events.remove_event(evt, func) except it takes an object with a list of events and functions.
Function ng.Events.clear_events (evt) vs. 1.1.0 Full+Lite
Remove all the functions under the event name evt.
Function ng.Events.clear_all_events () vs. 1.1.0 Full+Lite
This function works the same way Events.clear_events(evt) except it removes all the events attached to the object.
Function ng.Events.fire_event (evt_nm, args, evt) vs. 1.1.0 Full+Lite
Executes all the functions in the event evt_nm queue. Functions are executed in lasted added first exectued order.