<script type="text/javascript">
    $(function() {

        $("#<%=txtSearch.ClientID%>").focus(function() {

            if ($(this).val() == "请输入搜索内容") {

                $(this).css("color", "black").val("");
            }
        }).blur(function() {
            //光标离开
            if ($(this).val() == "") {
                $(this).css("color", "Gray").val("请输入搜索内容");

            }
        });
        
        
        $("#<%=txtSearch.ClientID%>").autocomplete({
           source: "/ashx/AutoComplete.ashx",
           minLength:2
        });
    });

</script>

 txtSearch是搜索框的id

相关文章:

  • 2022-12-23
  • 2021-11-28
  • 2022-01-03
  • 2022-12-23
  • 2022-12-23
  • 2021-04-06
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-03-07
  • 2021-12-09
  • 2022-12-23
  • 2021-12-22
  • 2021-12-24
  • 2022-12-23
  • 2021-12-06
相关资源
相似解决方案