I'm new here and look for a way to create multiple elements by using jquery.
Here's an example. I create a table and append a row. How could i include 4 rows more without using createElement?
function table(){
$(document.createElement("table")).appendTo($('body'))
$(document.createElement('tr')).appendTo($('table'))
}
jquery/pure js?$( "body" ).append( "<table><tr></tr><tr></tr><tr></tr><tr></tr></table>" );instead for example.appendToto return the newly appended elementvar tbl = $("<table>").appendTo("body"); var tr = $("<tr>").appendTo(tbl); cols.forEach(c => tbl.append("<td>"))etc