Question 14
Consider the following HTML file and select the correct option.
<!DOCTYPE html><html lang="en"><body> <table id="rows"> <tr> <th>Name</th> <th>City</th> </tr> </table> <button onclick="perform()">action</button> <script> function perform(){ let row = document.createElement("tr") let td1 = document.createElement("td") td1.innerText = "name_1" let td2 = document.createElement("td") td2.innerText = "city_1" row.appendChild(td1) row.appendChild(td2) let rows = document.getElementById("rows") rows.appendChild(row) } </script></body></html>The action button when clicked adds a new column to the table with value “city_1”.
The action button when clicked adds a new column to the table with value “name_1”.
The action button when clicked adds a new row to the table with values “name_1” in the first column and “city_1” in the second column.
The action button when clicked adds a new row to the table with values “city_1” in the first column and “name_1” in the second column.