getElementsByTagName always return an HTMLCollection. So either this is not needed or the logic should fallback when the list of link elements is empty. I don't know what was the intention behind this so I've decided to just drop this since it's not working either way so most likely the other proposed solution is not needed by anyone.
getElementsByTagName
always return anHTMLCollection
. So either this is not needed or the logic should fallback when the list of link elements is empty. I don't know what was the intention behind this so I've decided to just drop this since it's not working either way so most likely the other proposed solution is not needed by anyone.