Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><a href="http://jsfiddle.net/hbpDm/1/" rel="nofollow">Here is a working example</a>. I changed the code to output to a div instead of an alert box. Your issue was <code>item.innerHTML</code> I believe. I use the jQuery <code>html</code> function instead and that seemed to resolve the issue.</p> <pre><code>&lt;table id='thisTable' class='disptable' style='margin-left:auto;margin-right:auto;' &gt; &lt;tr&gt; &lt;th&gt;Fund&lt;/th&gt; &lt;th&gt;Organization&lt;/th&gt; &lt;th&gt;Access&lt;/th&gt; &lt;th&gt;Delete&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class='fund'&gt;100000&lt;/td&gt;&lt;td class='org'&gt;10110&lt;/td&gt;&lt;td&gt;OWNED&lt;/td&gt;&lt;td&gt;&lt;a class='delbtn'ref='#'&gt;X&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class='fund'&gt;100000&lt;/td&gt;&lt;td class='org'&gt;67130&lt;/td&gt;&lt;td&gt;OWNED&lt;/td&gt;&lt;td&gt;&lt;a class='delbtn' href='#'&gt;X&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class='fund'&gt;170252&lt;/td&gt;&lt;td class='org'&gt;67130&lt;/td&gt;&lt;td&gt;OWNED&lt;/td&gt;&lt;td&gt;&lt;a class='delbtn' href='#'&gt;X&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class='fund'&gt;100000&lt;/td&gt;&lt;td class='org'&gt;67150&lt;/td&gt;&lt;td&gt;PENDING ACCESS&lt;/td&gt;&lt;td&gt;&lt;a class='delbtn' href='#'&gt;X&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt;&lt;td class='fund'&gt;100000&lt;/td&gt;&lt;td class='org'&gt;67120&lt;/td&gt;&lt;td&gt;PENDING ACCESS&lt;/td&gt;&lt;td&gt;&lt;a class='delbtn' href='#'&gt;X&lt;/a&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;div id="output"&gt;&lt;/div&gt;​ </code></pre> <p>the javascript:</p> <pre><code>$('#thisTable tr').on('click', function(event) { var tds = $(this).addClass('row-highlight').find('td'); var values = ''; tds.each(function(index, item) { values = values + 'td' + (index + 1) + ':' + $(item).html() + '&lt;br/&gt;'; }); $("#output").html(values); }); </code></pre>
    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.
    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