Note that there are some explanatory texts on larger screens.

plurals
  1. POreturning 1st column from table over and over again
    primarykey
    data
    text
    <p>I am trying to get the value of my td column with a specific class (tablecellname):</p> <pre><code> $('#MainContent_myTable tr').each(function () { console.log($('.tablecellname').html()); }); </code></pre> <p>I think I get the correct amount of rows in the table but it only gives me the 1st value (repeated).</p> <pre><code>&lt;table id='MainContent_myTable'&gt; &lt;tr&gt; &lt;td class='tablecellname'&gt;abc&lt;/td&gt; &lt;td class='tablecellcode'&gt;111&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class='tablecellname'&gt;def&lt;/td&gt; &lt;td class='tablecellcode'&gt;222&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class='tablecellname'&gt;ghi&lt;/td&gt; &lt;td class='tablecellcode'&gt;333&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class='tablecellname'&gt;jkl&lt;/td&gt; &lt;td class='tablecellcode'&gt;444&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class='tablecellname'&gt;mno&lt;/td&gt; &lt;td class='tablecellcode'&gt;555&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class='tablecellname'&gt;pqr&lt;/td&gt; &lt;td class='tablecellcode'&gt;666&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class='tablecellname'&gt;stu&lt;/td&gt; &lt;td class='tablecellcode'&gt;777&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class='tablecellname'&gt;vwx&lt;/td&gt; &lt;td class='tablecellcode'&gt;888&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class='tablecellname'&gt;yz&lt;/td&gt; &lt;td class='tablecellcode'&gt;999&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; </code></pre> <p>It only prints abc over and over again.</p> <p>What am I doing incorrectly? </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload