<!DOCTYPE HTML><html><head><title>Test</title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.5.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
$('.todoitem').click(function() {
alert('ok');
}).click();
</script>
</head>
<body>
<h1>25 Feb 2011</h1>
<h3>ABC</h3>
<ul>
<div>
<a href="http://www.barnsley-chronicle.co.uk" class="todoitem">I want to click here</a> </div>
</li>
</ul>
</body>
</html>
我很困惑。我需要做的就是单击 class="todoitem" 中的链接。
难道我做错了什么?