Q:

Finds all elements that are empty using jquery

0

Finds all elements that are empty using jquery

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

HTML Code :

<!DOCTYPE html>
<html>
<head>
<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>
</head>
<body>
<table border="1">
<tr><td>R1C1</td><td></td><td>R1C3</td></tr>
<tr><td>R2C1</td><td>R2C2</td><td></td></tr>
<tr><td></td><td>R3C2</td><td>R3C3</td></tr>
</table>
</body>
</html>

JavaScript Code :

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

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now