Renders a view containing a piece of the UI; returns the UI element.
showAlert method will show an alert message when called
Param | Type | Description |
---|---|---|
message | string |
a text message |
className | string |
a CSS class |
creates a todo object and creates a piece of UI calling the render function in the object and appends it to the DOM.
Param | Type |
---|---|
e | event |
deletes all the todo's UI elements from the DOM and empties the localStorage.
It checks if there are any items in the localStorage and creates UI elements (todo's elements) from them. Then it adds them to the DOM.
It checks if there are any todo's UI elements in the DOM and save them in the localStorage.