jQuery Selector How to - Select everything below an element








Question

We would like to know how to select everything below an element.

Answer


<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#master noscript ~ li {<!-- w w w  .java2  s  .  c  o m-->
  color: red;
}
</style>
</head>
<body>
  <ul id="master">
    <li class="item">1</li>
    <li class="item">2</li>
    <li class="item">3</li>
    <li class="item">4</li>
    <li class="item">5</li>
    <li class="item">6</li>
    <noscript></noscript>
    <li class="item">7</li>
    <li class="item">8</li>
    <li class="item">9</li>
    <li class="item">10</li>
  </ul>
</body>
</html>

The code above is rendered as follows: