Step 1:
<div>
<label for="tags">Tags: </label>
<input id="tags" />
</div>
Step 2:
<script>
var sourcedata = [
"asp.net",
"Asp",
"BASIC",
"C",
"C++",
"COBOL",
"Fortran",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$("#tags").autocomplete({
source: sourcedata,
open: function (event, ui) {
var adddiv = $("<div style=\"width: auto; background: #f5f5f5;border-top: 1px solid #c7c7c7;margin-top: 0.92307692em; padding: 0 0.46153846em;overflow: hidden;\"> Close</div>", {
});
adddiv.click(function () {
$(event.target).autocomplete("close");
});
$(this).autocomplete("widget").append(adddiv);
}
});
</script>
<div>
<label for="tags">Tags: </label>
<input id="tags" />
</div>
Step 2:
<script>
var sourcedata = [
"asp.net",
"Asp",
"BASIC",
"C",
"C++",
"COBOL",
"Fortran",
"Java",
"JavaScript",
"Lisp",
"Perl",
"PHP",
"Python",
"Ruby",
"Scala",
"Scheme"
];
$("#tags").autocomplete({
source: sourcedata,
open: function (event, ui) {
var adddiv = $("<div style=\"width: auto; background: #f5f5f5;border-top: 1px solid #c7c7c7;margin-top: 0.92307692em; padding: 0 0.46153846em;overflow: hidden;\"> Close</div>", {
});
adddiv.click(function () {
$(event.target).autocomplete("close");
});
$(this).autocomplete("widget").append(adddiv);
}
});
</script>
0 comments:
Post a Comment