Web Development

How to add a new tr in jquery?

August 22, 2009 · 1 Comment

Hello user,

This is very simple. First of all you must have all pimary jquery javascripts files.

Then use this code…

function add_another(table_id){
var newtr=”
put some code

“;
$(table_id).append($(table_id +newtr));
return true;
}

It will add another tr taking a clone of last tr of table whose id is ‘table’.

You have to invode this function on click, then write…

<a href=”#” onclick=”#table_id”>Add another tr</a>

Categories: jQuery

1 response so far ↓

  • ajmaltash // August 22, 2009 at 1:39 pm | Reply

    This is very helpfull code. I have every one will get help.

Leave a Comment