Yeak Yeak - 1 year ago 90
jQuery Question

jquery select new element outside of this.parent

i have teh following html

<td class="schedule-available" style="background-color: rgb(255, 128, 128);"> 09:00 AM - 01:00 PM
<button class="btn btn-primary btn-xs viewOrder" type="button">ViewOrder</button>


<td class="sm-fnt lastName-holder">Last name: </td>

currently with my code $(this).parent() is referring to the first what im trying to do now is also find the to be able to change the text from last name to something else please keep in mind i have mutliple lists like this so thats why i need to use $(this).parent

iv tried the following


but neighter works

Answer Source

Try this $(this).parent().closest('tr').next().find('.lastName-holder').html('test');

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download