<!doctype html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="Generator" content="EditPlus®"> <meta name="Author" content=""> <meta name="Keywords" content=""> <meta name="Description" content=""> <title>Document</title> </head> <body> <script type="text/javascript" src="http://files.cnblogs.com/wzq806341010/jquery-1.7.2.min.js"></script> <script type=‘text/javascript‘ src="http://files.cnblogs.com/wzq806341010/jquery-ui-latest.js"></script> <link href="http://files.cnblogs.com/wzq806341010/jquery-ui.css" rel="stylesheet" type="text/css" /> <script type="text/javascript"> $(function(){ $("input").live("focus click", function () { var $event = $(this); $event.autocomplete({ source: [‘1‘,‘2‘], minLength: 0, delay: 0,splitStr:"^", create: function (event, ui) { $event.live("focus click", function () { var active = $event.data("autocomplete").menu.active; if (!active) { $event.autocomplete("search", $event.val()); } }); } }); }); }); </script> <input type=‘text‘ value="" /> </body> </html>
JQuery自动填充控件:autocomplete(自己稍作了修改)
时间: 2024-08-04 10:44:10