Windows 10 will reach EOS (end of support) on October 14, 2025. For more information, see this article.

Search Support

Avoid support scams. We will never ask you to call or text a phone number or share personal information. Please report suspicious activity using the “Report Abuse” option.

Learn More

documentElement.getElementsbyTagName("")[0] is not working in Firefox latest version. Is it a bug?

  • 7 replies
  • 5 have this problem
  • 9 views
  • Last reply by radhanithi

more options

I am getting 'not defined' exception while using documentElement.getElementsbyTagName("data")[0] this method

I am getting 'not defined' exception while using documentElement.getElementsbyTagName("data")[0] this method

Chosen solution

character 'ß' causes the issue.

Read this answer in context 👍 0

All Replies (7)

more options

Make sure that you spell it correctly:

documentElement.getElementsByTagName("data")[0];
more options

You might still need document, e.g.,:


document.documentElement.getElementsByTagName("body")[0];
more options

Thank you for the response.

I tried document.documentElement.getElementsByTagName("data")[0]; Still It doesn't work.

more options

How many <data> tags do you have in the document?? If you select all, right-click, and View Selection Source, you can search in the source as modified by your scripts.

Is this an HTML or an XML document? What is your DOCTYPE declaration?

If you have a page online that demonstrates the problem, please provide a link so we can tackle it more efficiently.

more options

Its XML document. I have one data tag.

I think we found the root cause. data is huge and there are words which contains special characters like S�or , 'Opéra etc., Firefox latest version is unable to parse XML which has this characters.

Either we need to escape these characters or remove the whole word. But still wondering how this works in Linux Firefox 7 and previous version and not in latest version ?.

Any other suggestion to fix this without escape these characters or remove the whole word?

more options

Perhaps the behavior was changed to enforce standards more strictly. That sort of change has happened in the past. Or maybe it's a bug. Either way, answering questions about XML parsing probably is beyond the scope of this support forum. Perhaps try here:

mozillaZine Web Development board

It's a separate forum with separate registration. Please note the tips in the Sticky Post at the top of the forum before posting.

more options

Chosen Solution

character 'ß' causes the issue.