HTML File
<table id="studenttable">
<thead>
<tr>
<td>Roll No.</td>
<td>Student Name</td>
</tr>
</thead>
<tbody>
<!-- existing data could optionally be included here -->
</tbody>
</table>
<template id="studentrow"> //Template created
<tr>
<td class="record"></td>
<td></td>
</tr>
</template>
CSS File
table
{
background: #000;
}
table td
{
background: #fff;
}
JS File
if ('content' in document.createElement('template'))
{
var t = document.querySelector('#studentrow'),
td = t.content.querySelectorAll("td");
td[0].textContent = "101";
td[1].textContent = "ABC";
// Clone the new row and insert it into the table
var tb = document.querySelector("tbody");
var clone = document.importNode(t.content, true);
tb.appendChild(clone);
// Create a new row
td[0].textContent = "102";
td[1].textContent = "PQR";
// Clone the new row and insert it into the table
var clone2 = document.importNode(t.content, true);
tb.appendChild(clone2);
}
else
{
// Find another way to add the rows to the table because
// the HTML template element is not supported.
}
<input list="countries">
<datalist id="countries">
<option value="India">India</option>
<option value="United States"></option>
<option value="United Kingdom"></option>
<option value="Indonesia"></option>
<option value="Iraq"></option>
<option value="Ireland"></option>
</datalist>
<!DOCTYPE html>
<html>
<body>
<form>
<fieldset>
<legend>Basic Information:</legend>
Name: <input type="text"><br>
Email: <input type="text"><br>
DOB : <input type="text">
</fieldset>
</form>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
<p>Display a gauge:</p>
<meter value="2" min="0" max="10">2 out of 10</meter><br>
<meter value="0.6">60%</meter>
</body>
</html>
<!DOCTYPE html>
<html>
<body>
Downloading:
<progress value="22" max="100">
</progress>
</body>
</html>