-
-
Save equivalent/2a18a96b99f2dc2eec81d890f2efc5ee to your computer and use it in GitHub Desktop.
Revisions
-
phoebebright created this gist
Jul 18, 2018 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ <div class="row"> <div class="col s12"> <div class="row"> <div class="input-field col s13"> <i class="material-icons prefix">textsms</i> <input type="text" id="autocomplete" class="autocomplete" > <label for="autocomplete">Autocomplete</label> </div> </div> </div> </div> ID: <p id="key"></p> <button class="btn" onclick="getId()">Get</button> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ Materialize AutoComplete with id -------------------------------- A [Pen](https://codepen.io/arg3ni5/pen/ygpZLx) by [Fabian Chinchilla ](https://codepen.io/arg3ni5) on [CodePen](https://codepen.io). [License](https://codepen.io/arg3ni5/pen/ygpZLx/license). This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ $(document).ready(function() { $('.modal').modal(); $('select').material_select(); $('input.autocomplete').autocomplete2({ data: [ {id:1,text:'Apple',img:'http://placehold.it/250x250'}, {id:2,text:'Microsoft',img:'http://placehold.it/250x250'}, {id:3,text:'Google',img:'http://placehold.it/250x250'}, ] }); }); function getId() { alert($('#autocomplete').data('id')); }
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ <script src="https://codepen.io/arg3ni5/pen/VPQZwe"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.0/jquery.min.js"></script> This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1 @@ <link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css" rel="stylesheet" />