blur事件

    <script type="text/javascript">
        $(function () {
            $("input:text").blur(function () {//失去焦点时
                if ($(this).val().length > 0)
                    $(this).css("background", "red");
                else
                    $(this).css("background", "white");
            })
        })
    </script>
posted @ 2012-06-17 15:51  haiziguo  阅读(234)  评论(0编辑  收藏  举报