<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css">
<script src="//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!------ Include the above in your HEAD tag ---------->
<!DOCTYPE html>
<html>
<head>
<style>
table tr td{
border:1px solid black;
}
</style>
</head>
<body>
<h2>JavaScript Comparison</h2>
<p>Assign 5 to x, and display the value of the comparison (x == 8):</p>
<table>
<thead>
<tr>
<td>Name</td><td>Age</td><td>Action</td></tr>
</thead>
<tbody id="demo">
</tbody>
</table>
<script>
var obj={name:'lavan',age:20,gender:'male',child:[ {name:'lavanSon',age:2},{name:'lavanDon',age:3},{name:'lavanWon',age:5}]
}
var arr=obj.child;
forLoopFunction()
function del(inh){
document.getElementById('demo').innerHTML=''
arr.splice(inh,1)
forLoopFunction()
}
function forLoopFunction(){
for(var i=0;i<arr.length;i++){
document.getElementById('demo').innerHTML+="<tr> <td>"+arr[i].name+" </td>" + "<td>"+arr[i].age+"</td> <td><button onclick='del("+i+")'>Delete</button></td></tr>";
}
}
</script>
</body>
</html>