Edit: It's not a duplicate of "Fastest DOM insertion" because it includes the event listeners variable too. Anyway I will edit the question.
I would to know some things if someone already discovered.
I would like to know which is the fastest way to add an element in javascript and to be compatible with ie6+, chrome10+, firefox2+.
Fastest technique to:
- Add a single element
- Add 100 elements
Any time curve for adding 1 element or 1000 elements
The same as above but for removing an element
Add/Change/Remove an inline style attribute
Add event listeners like mousedown/mouseup/mouseover
Is faster to add/remove some tags over others? ex: is faster to add/remove a
<div>
or a<p>
? (In the adding mode: I think is faster<p>
because it only has 1 letter vs 3 letters, and maybe because div is a container. I don't know, that's why I'm asking :D)- Remove an element, save into js somehow, then re-add it and keep the event listeners working as it were before removing the element
This a big question, so if you only know some of the questions you can always share what you know ;)
thanks thanks!!