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
"Untitled"
Bootstrap 4.1.1 Snippet by
krunb
4.1.1
Preview
HTML
JS
View Full Screen
Fork
Fork this
515
 
0 Fav
Post to Facebook
Tweet this
<link href="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet" id="bootstrap-css"> <script src="//maxcdn.bootstrapcdn.com/bootstrap/4.1.1/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 ----------> <div class="container py-5"> <div class="position_show_adv_div"> <div class="row "> <div class="col-xl-3 col-lg-4 col-md-6 col-sm-6"> <select name="" id="" class="form-control show_adv"> <option value="" disabled selected> show adv </option> <option value="1"> Home </option> <option value="2"> Cateogry</option> <option value="3"> Sub Cateogry</option> <option value="4"> PopUp</option> </select> </div> <div class="show_adv_option col-xl-9 col-lg-8 col-md-6 col-sm-6"> <div class="form-row"> <div class="col-auto"> <!-- <select name="" id="" class="form-control"> <option value="" disabled selected> Category </option> <option value="1"> Category 1</option> <option value="2"> Category 2</option> <option value="3"> Cateogry 3</option> <option value="4"> Category 4</option> </select> --> </div> <div class="col-auto"> <button type="button" class="btn btn-danger">delete</button> </div> </div> </div> </div> </div> <div class="row mt-4"> <div class="col-xl-12"> <button type="button" class="btn btn-success position_show_adv"> Add Position </button> </div> </div> </div>
$(".show_adv").on("change", function(){ var show_adv = $(this).val(); alert(show_adv); }); var i = 0; $(".position_show_adv").on("click", function(){ var html = '\ <div class="row" id="position_'+ i +'">\ <div class="col-xl-3 col-lg-4 col-md-6 col-sm-6">\ <select name="" id="" class="form-control show_adv">\ <option value="" disabled selected> show adv </option>\ <option value="1"> Home </option>\ <option value="2"> Cateogry</option>\ <option value="3"> Sub Cateogry</option>\ <option value="4"> PopUp</option> \ </select>\ </div>\ <div class="show_adv_option col-xl-9 col-lg-8 col-md-6 col-sm-6">\ <div class="form-row">\ <div class="col-auto">\ <!--\ <select name="" id="" class="form-control">\ <option value="" disabled selected> Category </option>\ <option value="1"> Category 1</option>\ <option value="2"> Category 2</option>\ <option value="3"> Cateogry 3</option>\ <option value="4"> Category 4</option> \ </select>\ -->\ </div>\ <div class="col-auto">\ <button type="button" class="btn btn-danger" onclick="remove_position('+ i +')">delete</button>\ </div>\ </div>\ </div>\ </div>'; $(".position_show_adv_div").append(html); $i++; }); function remove_position(position_id){ $("#position_"+ position_id).remove(); }
Related:
See More
Free Template
Vue Material Kit
Questions / Comments:
Post
Posting Guidelines
Formatting
- Now
×
Close
Donate
BTC: 12JxYMYi6Vt3mx3hcmP3B2oyFiCSF3FhYT
ETH: 0xCD715b2E3549c54A40e6ecAaFeB82138148a6c76