Haven't worked much on front-end and was wondering if what I did is correct.
I have created an html
table that displays data.
I have added button and check-boxes to modify structurally the table i.e. add a row.
The code to do that is a big block of code that does something like:
var table = document.getElementById('table');
table.insertRow(1);
var id_td = document.createElement('td');
//create options element
id_td.appendChild(options);
var name_td = document.createElement('td');
//create input textbox
name_td.appendChild(txt_box);
etc etc
So I don't like the fact that it is a really big-block of essentially repeating code that creates the elements.
I wanted to know, am I on the right track? Is this the only way unless we use some library like JQuery
?