Reputation: 317
I am having following hardcoded table data
<td colspan="4">
<textarea rows="4" cols="40"></textarea>
</td>
but I want to do this thing using Javascript or jQuery can anyone tell me how to do this.
Upvotes: 2
Views: 4718
Reputation:
Just do it.
var td = document.createElement('td');
td.setAttribute('colspan', '4');
var textarea = document.createElement('textarea');
textarea.setAttribute('rows', '4');
textarea.setAttribute('cols', '40');
td.appendChild(textarea);
Upvotes: 1