为什么这个jQuery事件会运行两次?

csd*_*dxf 4 javascript jquery events

当您运行此代码并单击时input2,它将获得焦点,.resultdiv将输出"f2"一次.但是当你点击时input1,脚本会让input2焦点和.resultdiv输出"f2"两次,为什么?

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>blank</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){   
    $(".input1").click(function(){$(".input2").focus();});
    $(".input2").focus(function(){$(".result").html($(".result").html()+"f2, ");});
});
</script>
</head>

<body>
    <p>
        <input class="input1" value="click me to set the input2's focus" />
        <input class="input2" value="input2" />
        <div class="result"></div>
    </p>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)

Dom*_*let 7

这是一个已知的jquery错误:

http://bugs.jquery.com/ticket/6705

IE错误地调用了focus两次.