Skip to content
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

Bug/typo in "Manipulating pages" chapter #228

Open
lucio-cornejo opened this issue Apr 12, 2023 · 0 comments
Open

Bug/typo in "Manipulating pages" chapter #228

lucio-cornejo opened this issue Apr 12, 2023 · 0 comments

Comments

@lucio-cornejo
Copy link

In the section "Sortable Lists" of the "Manipulating pages" chapter, the first JavaScript code presents a typo, using
document.querySelectorAll('#sorted')) where it should be (as later explained in the same section) document.querySelectorAll('.sorted')).

After changing that typo, the initial example (using onload for the body) does produce sorted lists, which the book emphasises should not have happened still (but only after we use the DOMContentLoaded event).

Due to the fact that it's not always the case that the DOMContentLoaded event occurs before the load one, a possible way to fix this example/section could be to change the typo (using .sorted) but not including the onload attribute for the body element.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant