- jQuery is sucks
- All you need to know is 2 methods: document.createElement () and appendChild ()
See the code below:
var node = document.createElement("DIV"); node.style. ... = ... ;
For example, if you need a class:
node.setAttribute("class", "class_name second_class_name");
Set the block text and then just copy your prototype block into the DOM method:
node.innerHTML = "Text of block"; document.getElementById("container_id").appendChild(node);
And again:
node.innerHTML = "Text of second block"; document.getElementById("container_id").appendChild(node);
So you can display as many times as you need
Hi
Volodymyr Matvienko
source share