JSFiddle - React, Tailwind, and code Playground

by shraddhapaghdar

HTML

<div class="content">
  <a href="https://www.delftstack.com/howto/python/">Python</a>
  <a href="https://www.delftstack.com/howto/angular/">Angular</a>
  <a href="https://www.delftstack.com/howto/react/">React</a>
  <a href="https://www.delftstack.com/howto/node.js/">Node.js</a>
  <a href="https://www.delftstack.com/howto/php/">PHP</a>
  <a href="https://www.delftstack.com/howto/java/">Java</a>
  <a href="https://www.delftstack.com/howto/c/">c</a>
</div>

JavaScript

var second = document.querySelector(".content a:nth-child(3)")
console.log("second", second)

var even = document.querySelectorAll(".content a:nth-child(3n)")
console.log("even", even)