"add data"
Bootstrap 4.0.0 Snippet by lavan

<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> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> </head> <body> <input type="text" placeholder="studentname" id="sn"> <input type="number" placeholder="studentId" id="si"> <input type="text" placeholder="studentAddress" id="sa"> <input type="date" placeholder="studentjoindate" id="sj"> <input type="date" placeholder="studentupdated" id="su"> <button onclick="add()">Add</button> <table class="table table-bordered" > <thead> <th>Sl.No</th> <th>Std name</th> <th>Std Id</th> <th>Std address</th> <th>Joined Date</th> <th>Std updated</th> <th>Action</th> <tbody id="all"></tbody> </thead> </table> <script> var ary=[] function add() { var one=document.getElementById('sn').value var two=document.getElementById('si').value var three=document.getElementById('sa').value var four=document.getElementById('sj').value var five=document.getElementById('su').value ary.push(lk) alert(ary.length); var lk= document.getElementById('all').innerHTML+="<tr id='allo'><td>"+ary[0]+"</td>"+"<td>"+one+"</td>"+"<td>"+two+"</td>"+"<td>"+three+"</td>"+"<td>"+four+"</td>"+"<td>"+five+"</td>"+"<td>"+"<button onclick='lav(this)'>Edit</button>"+"</td></tr>" document.getElementById('allo').innerHTML+=ary } </script> </body> </html>

Related: See More


Questions / Comments: