Guest User

semanticUI

a guest
Jun 6th, 2020
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 5 3.33 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Title</title>
  6.  
  7.     <!-- Bootstrap Links -->
  8.     <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
  9.     <!-- JS, Popper.js, and jQuery -->
  10.     <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
  11.     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
  12.     <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
  13.  
  14.  
  15.     <!-- Jquery -->
  16.     <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
  17.  
  18.     <!--    &lt;!&ndash; for handle Bar &ndash;&gt;-->
  19.     <!--    <script src="https://twitter.github.io/typeahead.js/js/handlebars.js"></script>-->
  20.  
  21.     <!--Semantics Ui CDN  -->
  22.     <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css">
  23.     <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.js"></script>
  24.  
  25.     <!-- select2 -->
  26.     <!--    <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />-->
  27.     <!--    <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>-->
  28.  
  29.     <!--Semantics JSS -->
  30. </head>
  31. <body>
  32.         <div class="container">
  33.             <div class="ui search">
  34.                 <div class="ui icon input">
  35.                     <input class="prompt" type="text" placeholder="Search countries...">
  36.                     <i class="search icon"></i>
  37.                     <span class="text"></span>
  38.                 </div>
  39.                 <div class="results"></div>
  40.             </div>
  41.         </div>
  42. </body>
  43.  
  44. <script>
  45.     var content = [
  46.         { title: 'Andorra' },
  47.         { title: 'United Arab Emirates' },
  48.         { title: 'Afghanistan' },
  49.         { title: 'Antigua' },
  50.         { title: 'Anguilla' },
  51.         { title: 'Albania' },
  52.         { title: 'Armenia' },
  53.         { title: 'Netherlands Antilles' },
  54.         { title: 'Angola' },
  55.         { title: 'Argentina' },
  56.         { title: 'American Samoa' },
  57.         { title: 'Austria' },
  58.         { title: 'Australia' },
  59.         { title: 'Aruba' },
  60.         { title: 'Aland Islands' },
  61.         { title: 'Azerbaijan' },
  62.         { title: 'Bosnia' },
  63.         { title: 'Barbados' },
  64.         { title: 'Bangladesh' },
  65.         { title: 'Belgium' },
  66.         { title: 'Burkina Faso' },
  67.         { title: 'Bulgaria' },
  68.         { title: 'Bahrain' },
  69.         { title: 'Burundi' }
  70.         // etc
  71.     ];
  72.  
  73.     $('.ui.search')
  74.         .search({
  75.             source: content
  76.         });
  77.  
  78.     $(".prompt").on("input", function(data){
  79.         console.log($(".prompt").val());
  80.         $(".text").text($(".prompt").val())
  81.  
  82.         // Make Ajax call here
  83.         // update the List of JSON documents
  84.     })
  85.  
  86.  
  87. </script>
  88.  
  89. </html>
Add Comment
Please, Sign In to add comment