marijnh / Eloquent-JavaScript

The sources for the Eloquent JavaScript book
https://eloquentjavascript.net
3.03k stars 799 forks source link

Chapter 15 - Exercise "Tabs" - Inconsistent wrapping <div> to sandbox solution #337

Closed PolarisTLX closed 6 years ago

PolarisTLX commented 6 years ago

In the last exercise of Chapter 15, "TABS", the problem is laid out as:

<tab-panel>
     <div...
     <div...
</tab-panel>
<script>
    .
    .
  asTabs(document.querySelector("tab-panel"));
</script>

But the solution in the sandbox is laid out as:

<div id="wrapper">
     <div...
     <div...
</div>
<script>
     .
     .
     asTabs(document.querySelector("#wrapper"));
</script>`

Recommend remaining consistent with "\<div id="wrapper">", which is the same as it was in the 2nd Edition.

marijnh commented 6 years ago

Thanks for noticing that! Attached patch makes the solution match the exercise.