Horje Website
Bs Filters List Stacked – Bootstrap Filters – Bootstrap Filters – Bootstrap Code

Bs Filters List Stacked – Bootstrap Filters

Bs Filters List Stacked - Bootstrap Filters - Bootstrap Filters - Bootstrap Code


 
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <title>Bootstrap Example</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
  8. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
  9. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  10. </head>
  11. <body>
  12. <div class="container">
  13. <h2>Filterable List</h2>
  14. <p>Type something in the input field to search the list for specific items:</p>
  15. <input class="form-control" id="myInput" type="text" placeholder="Search..">
  16. <br>
  17. <ul class="list-group" id="myList">
  18. <li class="list-group-item">First item</li>
  19. <li class="list-group-item">Second item</li>
  20. <li class="list-group-item">Third item</li>
  21. <li class="list-group-item">Fourth</li>
  22. </ul>
  23. </div>
  24. <script>
  25. $(document).ready(function(){
  26. $("#myInput").on("keyup", function() {
  27. var value = $(this).val().toLowerCase();
  28. $("#myList li").filter(function() {
  29. $(this).toggle($(this).text().toLowerCase().indexOf(value) > -1)
  30. });
  31. });
  32. });
  33. </script>
  34. </body>
  35. </html>



Try Your Self ->



Published:
October 4, 2020
Author:
admin
Category:
Bootstrap 3, Bootstrap Source Code
Views:
16

This article was posted in Bootstrap 3, Bootstrap Source Code and tagged , , . Bookmark the permalink. Follow comments with the RSS feed for this post.Post a Comment or leave a trackback: Trackback URL.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

Horje © 2011 - 2022