title: Failed to mark every empty cell as Empty Cell with JQuery or Javascript
body: <p><strong>I searched for solutions to this but still I failed to replace each empty cell with the sentence &quot;empty cell&quot; with JQuery or Javascript, knowing that this technique only works if I give the cell its id &lt;td id=#cell&quot;&gt; for instance.
  You can see below that I've tried it with both Javascript and JQuery but with no results at all, I don't wish to use ids or classes for this matter, I wish to select all cells (&lt; td &gt;) that are empty, all at once, and then replace their value with &quot;empty cell&quot;.<br>
  Please help.</strong></p>
  <p>Code</p>
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot;&gt;
  &lt;head&gt;
      &lt;meta charset=&quot;UTF-8&quot;&gt;
      &lt;title&gt;Page title&lt;/title&gt;
  &lt;style&gt;
  table, th, td { border: 1px solid black; } th { cursor: pointer; }
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js&quot;&gt;&lt;/script&gt;
  &lt;table&gt;
          &lt;tr&gt;&lt;th&gt;id&lt;/th&gt;&lt;th&gt;name&lt;/th&gt;&lt;th&gt;age&lt;/th&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;1&lt;/td&gt;&lt;td&gt;Julian&lt;/td&gt;&lt;td&gt;31&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;B&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;3&lt;/td&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;25&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;4&lt;/td&gt;&lt;td&gt;Mindy&lt;/td&gt;&lt;td&gt;32&lt;/td&gt;&lt;/tr&gt;
          &lt;tr&gt;&lt;td&gt;5&lt;/td&gt;&lt;td id=&quot;dud&quot;&gt;&lt;/td&gt;&lt;td&gt;40&lt;/td&gt;&lt;/tr&gt;
      &lt;/table&gt;
  &lt;script&gt;
  if ($(&quot;td&quot;).html() == '') {
    $(&quot;td&quot;).html('Cell Empty');
  }
  
  
  if ($(&quot;#dud&quot;).html() == '') {
    $(&quot;#dud&quot;).html('Cell Empty');
  }
  
  
  const lis = document.getElementsByTagName(&quot;tr&quot;);
  if(lis.length === 0){
  lis.innerHTML = &quot;New text!&quot;;
  }
  &lt;/script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>