How to use Empty Selector Method in JQuery

This article describe about Empty Selector Method in JQuery.
  • 1682

Use :empty Selector method in jQuery

In this method , we select all empty elements.

The child elements and text elements are empty elements.


<!DOCTYPE html>



<script type="text/javascript" src="jquery.js"></script>

<script type="text/javascript">

    $(document).ready(function () {

        $(":empty").css("background-color", "blue");





<h1>Welcome to This Page</h1>



  <th>Student id</th>


































You may also want to read these related articles here

Ask Your Question 

Got a programming related question? You may want to post your question here

Programming Answers here

© 2020 DotNetHeaven. All rights reserved.