html
<input type="text" name="tb_ComplaintInfo.CompCase" id="tb_ComplaintInfo.CompCase"
class="mytext anyou" arr="CompCase" validate="empty" style="width: 80%" onchange="ChangeCase()" />
<div class="ulDiv" style="display:none;position:absolute;top:30px;left:3px;height:160px;width: 80%;overflow:auto;background: #fff;border: 1px solid #32ce8d;">
<ul id="ul"></ul>
</div>
js
$(function () {
$("#tb_ComplaintInfo\\.CompCase").click(function () {
$(this).focus();
var that = this;
$(".ulDiv").toggle().find("li").click(function () {
$(that).val($(this).text());
$(".ulDiv").hide();
});
return false;
})
// 点击页面的任何一点让input列表隐藏
$(document).click(function () {
$(".ulDiv").hide();
});
})