<!DOCTYPE html> <html> <head> <link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css"> <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"> <script src="http://code.jquery.com/jquery-1.8.3.min.js"></script> <script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script> <script src="http://code.jquery.com/ui/1.11.4/jquery-ui.js"></script> <script> $(function() { var availableTags = [ {label:"ActionScript",value:"1"}, {label:"AppleScript",value:"2"}, {label:"Asp",value:"2"}, {label:"BASIC",value:"2"}, {label:"C",value:"2"}, {label:"C++",value:"2"}, {label:"Clojure",value:"2"}, {label:"COBOL",value:"2"}, {label:"ColdFusion",value:"2"}, {label:"Erlang",value:"2"}, {label:"Fortran",value:"2"}, {label:"Groovy",value:"2"}, {label:"Haskell",value:"2"}, {label:"Java",value:"2"}, {label:"JavaScript",value:"2"}, {label:"Lisp",value:"2"}, {label:"Perl",value:"2"}, {label:"PHP",value:"2"}, {label:"Python",value:"2"}, {label:"Ruby",value:"2"}, {label:"Scala",value:"2"}, {label:"Scheme",value:"2"} ]; $( "#tags" ).autocomplete({ source: availableTags , select : function(event, ui){ var selectedObj = ui.item; $("#tags").val(selectedObj.label+ selectedObj.value); return false; } }); }); </script> </head> <body> <div data-role="page"> <div data-role="header"> <h1></h1> </div> <div data-role="content"> <label for="tags">Tags: </label> <input id="tags" type="search" placeholder="请输入物料名称或编号..."> </div> </div> </div> </body> </html>