Reading at MDN about Element.tagName it states:
On HTML elements in DOM trees flagged as HTML documents, tagName returns the element name in the upper
Work with element.tagName.toLowerCase()
if your code requires the output in lower case. If the standards change in the future to lowercase then you would not get a different value in your output since it's formatted to lowercase anyway.
On the contrary, if you left it without toLowerCase()
then your code output can change if the standards are changed to output as lowercase.
I doubt the standard will change for this though. This is entirely up to your needs.