Question: I have this simple html document:

```
    <header>
      <div><p>Fail</p></div>
      <p>Success!</p>
    </header>

```

How can I select the second paragraph using just the tag name.
I don't want to use something like this:

```
let successParagraph = document
   .getElementsByTagName("header")[0]
   .getElementsByTagName("p")[1];

```

because if I will insert another div that contains a paragraph I will have to change the children's number.

If I use something like this it doesn't work:

```
let successParagraph = document.getElementsByTagName("header > p");

```

Answer: 
```js
const secondElement = document.querySelectorAll('header p');

if (secondElement[1]) {
  let successParagraph = secondElement[1].innerHTML;
  console.log(successParagraph); // Success!
};
```

```html
<header>
    <div><p>Fail</p></div>
    <p>Success!</p>
 </header>
```
you can use `querySelectorAll`

```
const paragraphs = document.querySelectorAll("p");

```

`paragraphs[1]` would be the second one.