-
Notifications
You must be signed in to change notification settings - Fork 22.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lead section for xml/html DOM Text Node seems to provide an incorrect example #23353
Comments
For contributors, two ways to fix this issue:
<html lang="en" class="e"><head><title>Aliens?</title></head>
<body>Why yes.
</body></html> You would need to remember to add
Either solution is fine. |
Hi, @Josh-Cena! I would be happy to pick this issue and fix it. Also, when I run that code, I got the following result:
which is little different than what @KilianKilmister has. |
@dostonnabotov I can't get your result. Maybe you've inserted the code as a script tag? |
@Josh-Cena, I linked JavaScript with the script tag If this one is the correct output (by @KilianKilmister), I can use it to update the explaining text:
|
Indeed, you are not supposed to insert the script tag. If you just open the HTML code as-is, and run the script directly in your console, you should get the right result. |
Hello @dostonnabotov were you able to resolve this? if no i will like to pick this up |
Hi, @AbidemiT. Sorry for the delay. Yes, resolved it |
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/Text
What specific section or headline is this issue about?
Lead Section
What information was incorrect, unhelpful, or incomplete?
Claim of there only being 3 text nodes in the given example.
What did you expect to see?
At least 5 text nodes
Do you have any supporting links, references, or citations?
Based on opening a file with the content in a browser and running a TreeWalker over it.
Do you have anything more you want to share?
Regarding the following section, the statement about there being only three text nodes is incorrect, right?
I really don't see how that number was determined. Opening a local file with that content in a browser (Safari and Chrome) and running a TreeWalker over it will yield 5 text nodes instead. I'm astonishingly incapable with HTML, so I'm really not sure what to think.
Tree Walker:
Result:
MDN metadata
Page report details
en-us/web/api/text
The text was updated successfully, but these errors were encountered: