I'm just a hobbyist programmer, please bear with me.
I want to change an HTML5 table row's position in a certain table (let's say, from the 5th position to the 22nd) via plain JavaScript (no JQuery etc.). I see 2 possibilities:
A) copy the element's innerHTML
and paste it after the 21st row (one can use range for that);
B) append the node somewhere else (e.g., document.getElementById('my-parent-node').appendChild(document.getElementById('my-child-row-node'))
).
What I want to know is: what is faster for the browser to render, option A (changing an element's innerHTML
) or option B (appending the existing node somewhere else in the page)? Is there a performance difference at all?
Thank you very much