0

Here is what I am trying to produce:

"<td>"+name+"<textarea>"+content+"</textarea></td>";

I know jQuery can escape using:

jQuery("<td>", name)

But how do you incorporate some html in addition to it?

2
  • You append new elements to it Commented Mar 1, 2016 at 19:00
  • Incorporate HTML where? Commented Mar 1, 2016 at 19:05

1 Answer 1

1

You could use jQuery to create DOM elements and their properties/attributes dynamically with something like the following...

var name = 'name';
var content = 'content';

var $td = $('<td>', {
  html: $('<textarea>', {
    rows: 5
  }).text(content)
}).prepend(name);
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.