1

not sure why this doesn't work , but would like to know. When i place either individually they both produce the desired results , but i want to combine

var getHTML = $(data).find('.report tbody td');

$('div').html(getHTML + '<td>AddThis</td>');

this works

$('div').html(getHTML);

or this works , but not both combined

$('div').html('<td>AddThis</td>');
1
  • 1
    var getHTML = $(data).find('.report tbody td').html(); - in your code getHTML is an object, so works on its own, but when combined it becomes "[Object object]<tdAndThis</td>" Commented Feb 8, 2021 at 2:14

1 Answer 1

1

When you created a variable named getHTMl, then you did not put the .html() method there.

var getHTML = $(data).find('.report tbody td').html();

$('div').html(getHTML + "<td>AddThis</td>");

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.