< html >
< head >
< title > example < / title >
< script >
var toggleHidden=function () {
var elem= document.getElementById("toggle");
if(elem.hasAttribute("hidden")){
elem.removeAttribute("hidden")
}else{
elem.setAttribute("hidden","hidden");
}
}
< / script >
< / head >
< body >
<button onclick="toggleHidden()">toggle</button>
<table>
<tr><th>Name</th> <th>City</th></tr>
<tr id="toggle" hidden=""><td>Kevin</td><td>Shijiazhuang</td></tr>
<tr><td>Kevin</td><td>Shijiazhuang</td></tr>
</table>
< / body >
< / html >