jquery exercises

jQuery: Finds all elements that are empty

jQuery Fundamental - II : Exercise-83

Finds all elements that are empty.

Note: Don't have child elements or text.

Sample solution :

HTML Code :

<!DOCTYPE html>
<script src="https://code.jquery.com/jquery-git.js"></script>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Finds all elements that are empty.</title>
<table border="1">

JavaScript Code :

$( "td:empty" )
.text( "Empty!" )
.css( "background", "rgb(255,230,210)" );

See the Pen jquery-fundamental-exercise-83 by w3resource (@w3resource) on CodePen.

Contribute your code and comments through Disqus.

Previous: Removes all child nodes from all paragraphs.
Next: Find all input elements that are enabled.

What is the difficulty level of this exercise?

New Content: Composer: Dependency manager for PHP, R Programming