Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // createContainer(containerTitle)
- // createSection(containerTitle, sectionTitle, argumentsList) MAY ONLY CONTAINS ITEMS !
- // addItem(content, status)
- var todoListModule = (function () {
- var todoListModule = function () {
- // console.log("Todo list module created");
- };
- todoListModule.prototype.createContainer = function (containerTitle) {
- var body = document.getElementsByTagName("BODY")[0];
- var divContainer = document.createElement("DIV");
- var title = document.createElement("H4");
- var textnode = document.createTextNode(containerTitle);
- title.appendChild(textnode);
- divContainer.appendChild(title);
- body.appendChild(divContainer);
- };
- todoListModule.prototype.createSection = function (containerID, sectionTitle, argumentsList) {
- var container = document.getElementById(containerID);
- var title = document.createElement("H4");
- var textnode = document.createTextNode(sectionTitle);
- title.appendChild(textnode);
- container.appendChild(title);
- for (var i = 0; i < argumentsList.Length; i++) {
- // container.appendChild(argumentsList[i]);
- }
- };
- return todoListModule;
- }());
- var todo = new todoListModule();
- todo.createContainer("MY TODO LIST");
Advertisement
Add Comment
Please, Sign In to add comment