"checkbox"
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 lang="en"> <head> <title>Bootstrap Example</title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> </head> <body> <div class="container"> <input id="ftxt"> <input id="stxt"> <button onclick="load()">add</button> <table class="table table-bordered"> <thead> <tr> <th><input type="checkbox" onclick=chk(this)></th> <th>Fistname</th> <th>lastname</th> </tr> </thead> <tbody id="disp"> </tbody> </table> </div> <script> function load(){ var fst=document.getElementById('ftxt').value var sst=document.getElementById('stxt').value document.getElementById('disp').innerHTML+="<tr><td><input type='checkbox' class='lava'></td><td>"+fst+"</td><td>"+sst+"</td></tr>" } function chk(lv){ var kum=document.getElementsByClassName('lava') if (lv.checked){ for(var i=0;i<kum.length;i++){ kum[i].checked=true } } else{ for(var i=0;i<kum.length;i++){ kum[i].checked=false } } } </script> </body> </html>

Related: See More


Questions / Comments: