0

if my HTML is like this :

<tbody id="hasil-pencarian">
  <tr>
    <td align="center">1</td>
    <td>TMS/IT/06/001</td>
    <td>Erika Julia Widiyanti</td>
    <td>Marketing</td>
    <td>14-06-2015 13:59</td>
    <td>14-06-2015 14:00</td>
    <td>Erika test 1</td>

    <td id="action" class="center" width="10px">
        <a class="btn btn-success">
    </td>
   </tr>
</tbody>

I got all the html above like this :

var result = $("#hasil-pencarian").html();

But, How can I get all the HTML without the <td> with id='action' ? Little confused. Any help will be so appreciated.

0

1 Answer 1

5

I think you could create clone then remove the element then get the content like

var result = $("#hasil-pencarian").clone().find('#action').remove().end().html();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.