我使用的是jquery给控件注册事件,当页面加载完成后注册事件,代码是这样的<script type="text/javascript">
    $().ready(function() {
        $(".txtInput").focus(function() {
            $(this).removeClass("txtInput").addClass("usertxtInput");
        }) .blur(function() {
            $(this).removeClass("usertxtInput").addClass("txtInput");
        });    })</script>
这些代码都是放在html文件中的,但我很多地方都要调用这些,怎么样弄一下,可把这些代码放入单独的文件给控件注册事件呢