I used following code to highlight multiple record rows in a table. When I click button rows selected.But I refresh the page highlight disappeared. Can somebody help me how to remain the highlighted record even page is refreshed.
<script>
function highlight(ctrl) {
var parent = ctrl.parentNode.parentNode;
if(parent.classList == "New backChange") {
parent.classList.remove("backChange");
}
else {
parent.classList.add("backChange");
}
}
</script>
<style>
.backChange{
background:red;
}
</style>
<table id="appTable" style="margin-top:10px;" margin-left:10px;="" border="1">
<tbody>
<tr>
<th>Select</th>
<th>Name</th>
<th>Location</th>
<th>Action</th>
</tr>
<tr class="New">
<td><input id="mapCheck" name="myTextEditBox" type="checkbox"></td>
<td width="140">Name</td>
<td width="200">Location</td>
<td><button type="button" onclick="highlight(this)">select</button></td>
</tr>
<tr class="New">
<td><input id="mapCheck" name="myTextEditBox" type="checkbox"></td>
<td width="140">Name</td>
<td width="200">Location</td>
<td><button type="button" onclick="highlight(this)">select</button></td>
</tr>
<tr class="New">
<td><input id="mapCheck" name="myTextEditBox" type="checkbox"></td>
<td width="140">Name</td>
<td width="200">Location</td>
<td><button type="button" onclick="highlight(this)">select</button></td>
</tr>
<tr class="New">
<td><input id="mapCheck" name="myTextEditBox" type="checkbox"></td>
<td width="140">Name</td>
<td width="200">Location</td>
<td><button type="button" onclick="highlight(this)">select</button></td>
</tr>
</tbody>
</table>