Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <title>Title</title>
- <!-- Bootstrap Links -->
- <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
- <!-- JS, Popper.js, and jQuery -->
- <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
- <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
- <!-- Jquery -->
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
- <!-- <!– for handle Bar –>-->
- <!-- <script src="https://twitter.github.io/typeahead.js/js/handlebars.js"></script>-->
- <!--Semantics Ui CDN -->
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.css">
- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/semantic.min.js"></script>
- <!-- select2 -->
- <!-- <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/select2.min.css" rel="stylesheet" />-->
- <!-- <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/select2.min.js"></script>-->
- <!--Semantics JSS -->
- </head>
- <body>
- <div class="container">
- <div class="ui search">
- <div class="ui icon input">
- <input class="prompt" type="text" placeholder="Search countries...">
- <i class="search icon"></i>
- <span class="text"></span>
- </div>
- <div class="results"></div>
- </div>
- </div>
- </body>
- <script>
- var content = [
- { title: 'Andorra' },
- { title: 'United Arab Emirates' },
- { title: 'Afghanistan' },
- { title: 'Antigua' },
- { title: 'Anguilla' },
- { title: 'Albania' },
- { title: 'Armenia' },
- { title: 'Netherlands Antilles' },
- { title: 'Angola' },
- { title: 'Argentina' },
- { title: 'American Samoa' },
- { title: 'Austria' },
- { title: 'Australia' },
- { title: 'Aruba' },
- { title: 'Aland Islands' },
- { title: 'Azerbaijan' },
- { title: 'Bosnia' },
- { title: 'Barbados' },
- { title: 'Bangladesh' },
- { title: 'Belgium' },
- { title: 'Burkina Faso' },
- { title: 'Bulgaria' },
- { title: 'Bahrain' },
- { title: 'Burundi' }
- // etc
- ];
- $('.ui.search')
- .search({
- source: content
- });
- $(".prompt").on("input", function(data){
- console.log($(".prompt").val());
- $(".text").text($(".prompt").val())
- // Make Ajax call here
- // update the List of JSON documents
- })
- </script>
- </html>
Add Comment
Please, Sign In to add comment