ADD TR TO TABLE AFTER AN ONCHANGE IN SELECT [duplicate]

0

I want you to help me, I want to add a tr to the table by pressing a select with option, in the onchange function, I already have the data, just add to the table, my table has a tbody, inside that I want to add it , also that each time you add one does not erase the previous one.

    
asked by Jhon Oquendo 05.11.2018 в 16:38
source

1 answer

0

If you are using Jquery the solution is simple

$("table tbody").append(tu_tr);

You can also use the 'id' of the tbodyde your table to add it

$("id_de_tu_tbody").append(tu_tr);

the most important thing is to use the .append () function

If you do not use Jquery, you can look at this help link  which is based on pure jascript and with the insertRow function

    
answered by 05.11.2018 в 16:49