Is there any execution speed advantage to condense individual elements into an array as below and then call e instead of document.get….? Other than shorten the loading time of the script. TIA.
FROM
document.getElementById('id1')
document.getElementById('id2')
document.getElementById('id3')
TO
var e=document.getElementById("id1","id2","id3");
edit: I mean getElementById, not some specialized tags.
Two ways to do this could be:
It won’t gain speed initially (
document.getElementByIdis called as many times as it would be referencing the elements without a storage function), but will be more efficient if you subsequently need the elements in the remainder of your script.