Merge pull request #1572 from javascript-tutorial/paroche-patch-6

Update solution.md
This commit is contained in:
Peter Roche 2019-11-03 22:53:18 -07:00 committed by GitHub
commit b43e954391
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,6 @@ table.tBodies[0].append(...sortedRows);
3. Then sort them comparing by the content of the first `<td>` (the name field). 3. Then sort them comparing by the content of the first `<td>` (the name field).
4. Now insert nodes in the right order by `.append(...sortedRows)`. 4. Now insert nodes in the right order by `.append(...sortedRows)`.
Tables always have an implicit <tbody> element, so we need to take it and insert into it: a simple `table.append(...)` would fail. Tables always have an implicit `<tbody>` element, so we need to take it and insert into it: a simple `table.append(...)` would fail.
Please note: we don't have to remove them, just "re-insert", they leave the old place automatically. Please note: we don't have to remove them, just "re-insert", they leave the old place automatically.