Toggle navigation
Bootsnipp
Bootstrap
For
CSS Frameworks
Bootstrap
Foundation
Semantic UI
Materialize
Pure
Bulma
References
CSS Reference
Tools
Community
Page Builder
Form Builder
Button Builder
Icon Search
Dan's Tools
Diff / Merge
Color Picker
Keyword Tool
Web Fonts
.htaccess Generator
Favicon Generator
Site Speed Test
Snippets
Featured
Tags
By Bootstrap Version
4.1.1
4.0.0
3.3.0
3.2.0
3.1.0
3.0.3
3.0.1
3.0.0
2.3.2
Register
Login
"Course List Create"
Bootstrap 3.0.0 Snippet by
HakerTag
3.0.0
jQuery
Preview
HTML
CSS
JS
View Full Screen
Fork
Fork this
2.0K
 
2 Fav
Post to Facebook
Tweet this
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script> <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <!------ Include the above in your HEAD tag ----------> <form class="container"> <div class="row setup-content" id="step"> <div class="col-xs-12"> <div class="col-md-12 well text-center"> <h1> Course List</h1> <!-- <form> --> <div class="container col-xs-12"> <div class="row clearfix"> <div class="col-md-12 column"> <table class="table table-bordered table-hover" id="tab_logic"> <thead> <tr style="width:100%"> <th class="text-center" style="width:10%"> # </th> <th class="text-center" style="width:30%"> Course Code </th> <th class="text-center" style="width:70%"> Course Name </th> </tr> </thead> <tbody> <tr id='course0'> <td> 1 </td> <td> <input type="text" name='courseCode0' placeholder='Course Code' class="form-control"/> </td> <td> <input type="text" name='courseName0' placeholder='Course Name' class="form-control"/> </td> </tr> <tr id='course1'></tr> </tbody> </table> </div> </div> <a id="add_row" class="btn btn-success pull-left">Add Row</a><a id='delete_row' class="btn btn-danger pull-right">Delete Row</a> </div> <!-- </form> --> <button id="submite" class="btn btn-primary btn-md">Submite</button> </div> </div> </div> </form>
body{ margin-top:20px; }
$(document).ready(function(){ var i=1; $("#add_row").click(function(){ $('#course'+i).html("<td>"+ (i+1) +"</td><td><input name='courseCode"+i+"' type='text' placeholder='Course Code' class='form-control input-md' /> </td><td><input name='CourseName"+i+"' type='text' placeholder='Course Name' class='form-control input-md'></td>"); $('#tab_logic').append('<tr id="course'+(i+1)+'"></tr>'); i++; }); $("#delete_row").click(function(){ if(i>1){ $("#course"+(i-1)).html(''); i--; } }); });
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76