我有以下代码。
<html>
<head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
</head>
<div id="hello">Hello <div>Child-Of-Hello</div></div>
<br />
<div id="goodbye">Goodbye <div>Child-Of-Goodbye</div></div>
<script type="text/javascript"></script>
</html>
我希望只有在单击“Child-Of-Hello”时,$('div#hello').parents(target).length
将返回> 0。
然而,无论我在何处单击,它都会发生。
我的代码有什么问题吗?