---
id: 68599f9df77791c4a311cc5f
title: Step 7
challengeType: 0
dashedName: step-7
---

# --description--

The last item to add to each of the `button` elements are the `id` attributes. These will be used to link the `button` elements to their corresponding content panels.

The first `button` element should have an `id` of `"tab-earth"`, the second should have an `id` of `"tab-saturn"`, and the third should have an `id` of `"tab-mars"`.

# --hints--

Your first `button` element should have an `id` attribute.

```js
assert.isTrue(
  document.querySelectorAll("[role='tab']")[0].hasAttribute("id")
);
```

Your first `button` element should have an `id` attribute set to `"tab-earth"`.

```js
const firstBtn = document.querySelectorAll("[role='tab']")[0];
assert.equal(firstBtn.getAttribute("id"), "tab-earth");
```

Your second `button` element should have an `id` attribute.

```js
assert.isTrue(
  document.querySelectorAll("[role='tab']")[1].hasAttribute("id")
);
```

Your second `button` element should have an `id` attribute set to `"tab-saturn"`.

```js
const secondBtn = document.querySelectorAll("[role='tab']")[1];
assert.equal(secondBtn.getAttribute("id"), "tab-saturn");
```

Your third `button` element should have an `id` attribute.

```js
assert.isTrue(
  document.querySelectorAll("[role='tab']")[2].hasAttribute("id")
);
```

Your third `button` element should have an `id` attribute set to `"tab-mars"`.

```js
const thirdBtn = document.querySelectorAll("[role='tab']")[2];
assert.equal(thirdBtn.getAttribute("id"), "tab-mars");
```

# --seed--

## --seed-contents--

```html
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Planets Facts</title>
    <link rel="stylesheet" href="./styles.css" />
  </head>
  <body>
    <div class="tabs">
      <h2 id="tabs-title">Planets</h2>
      <div role="tablist" aria-labelledby="tabs-title">
        --fcc-editable-region--
        <button role="tab" aria-controls="panel-earth" aria-selected="true">🌍 Earth</button>
        <button role="tab" aria-controls="panel-saturn" aria-selected="false">🪐 Saturn</button>
        <button role="tab" aria-controls="panel-mars" aria-selected="false">🔴 Mars</button>
        --fcc-editable-region--
      </div>
    </div>

    <script src="./script.js"></script>
  </body>
</html>
```

```css
.tabs [role="tablist"] {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

[role="tab"] {
  padding: 0.5rem 1rem;
  background: #eee;
  border: 1px solid #ccc;
  cursor: pointer;
  font-weight: bold;
}

[role="tab"][aria-selected="true"] {
  background: #fff;
  border-bottom: 2px solid dodgerblue;
}

[role="tabpanel"] {
  border: 1px solid #ccc;
  padding: 1rem;
}
```
