Difference between revisions of "MediaWiki:Common.js"

From MakeICT Wiki
Jump to navigationJump to search
Line 5: Line 5:
 
   console.log(todoContainer);
 
   console.log(todoContainer);
 
   for(var i=0; i<todos.length; i++){
 
   for(var i=0; i<todos.length; i++){
     var clone = todos[i].cloneNode(true);
+
     var listItem = document.createElement("li");
    console.log(clone);
+
    listItem.appendChild(todos[i].cloneNode(true));
     todoContainer.appendChild(clone);
+
     todoContainer.appendChild(listItem);
 
   }
 
   }
  

Revision as of 11:48, 8 March 2015

/* Any JavaScript here will be loaded for all users on every page load. */
(function () {
  var todos = $(".makeict-todo");
  var todoContainer = $("#makeict-decision-summary")[0];
  console.log(todoContainer);
  for(var i=0; i<todos.length; i++){
    var listItem = document.createElement("li");
    listItem.appendChild(todos[i].cloneNode(true));
    todoContainer.appendChild(listItem);
  }

}());
/*
  var todos = $(".makeict-todo");
  var todoContainer = $("#makeict-decision-summary");
*/