This would lead to an infinite loop as document.getElementsByClassName() is an HTMLCollection and is live.

Checkout the following for more clarity -- https://stackoverflow.com/questions/28163033/when-is-nodelist-live-and-when-is-it-static#:~:text=An%20HTMLCollection%20is%20a%20list,the%20underlying%20document%20is%20changed.

Visit: https://bit.ly/devtools-yt for more amazing programming tutorials.