I want to get all the elements that are having an ID and want to store that id value in an array and I am using the following method:
var allTheElementsHavingID = document.querySelectorAll('[id]');
var allTheID = [];
for(i=0;i<allTheElementsHavingID.length;i++)
{
allTheID.push(allTheElementsHavingID[i].id);
}
But the problem here is that I am having around 15000 elements with an ID. and when I run the code in console it freezes the browser. so I want the alternative of the for loop here so as to store all the ID's Is there any other method?? that will prove more efficient