Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to find parent element and remove child element text of that parent in jquery?
    primarykey
    data
    text
    <p>Here is the markups i have used</p> <pre><code>&lt;table cellpadding="0" cellspacing="0" border="0"&gt; &lt;thead&gt; &lt;tr class="tr-head"&gt; &lt;th&gt;Amount Owed&lt;/th&gt; &lt;th&gt;Amount Paid&lt;/th&gt; &lt;th&gt;Check / Cash / Online&lt;/th&gt; &lt;th&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr class="row0"&gt; &lt;td&gt;$10 &lt;input type="text" name="amount_owed" id="amount_owed" value="10" style="display: none; width: 40px;" /&gt;&lt;/td&gt; &lt;td&gt;$20 &lt;input type="text" name="amount_paid" id="amount_paid" value="20" style="display: none; width: 40px;" /&gt;&lt;/td&gt; &lt;td&gt;$30 &lt;input type="text" name="check_cash_online" id="check_cash_online" value="30" style="display: none; width: 40px;" /&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:void(0);" class="edit-row" title="row0"&gt;Edit&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr class="row1"&gt; &lt;td&gt;$10 &lt;input type="text" name="amount_owed" id="amount_owed" value="10" style="display: none; width: 40px;" /&gt;&lt;/td&gt; &lt;td&gt;$20 &lt;input type="text" name="amount_paid" id="amount_paid" value="20" style="display: none; width: 40px;" /&gt;&lt;/td&gt; &lt;td&gt;$30 &lt;input type="text" name="check_cash_online" id="check_cash_online" value="30" style="display: none; width: 40px;" /&gt;&lt;/td&gt; &lt;td&gt;&lt;a href="javascript:void(0);" class="edit-row" title="row1"&gt;Edit&lt;/a&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre> <p>I want to remove first three child cell <code>td</code> text (i.e. $10, $20....) except <code>input</code> element when i click on Edit of particular row. Input type should be show After hiding text of cell. Please help me how can i make it using jquery script. thanks</p> <p>I have tried some script to do this i.e.</p> <pre><code>$(document).ready(function(){ $('.edit-row').click(function(){ var title = $(this).attr('title'); $('.'+title+' td').text(''); }); }); </code></pre> <p>But above script making cell empty.</p>
    singulars
    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.
 

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