我在文章元素中有链接。单击元素时,复选框会实现选中属性。但是这个元素内的链接是不活动的。
我如何改进此脚本以使链接可用?
<article class="post short-post">
<header><h3 class="post_title"><a href="/posts/2">Yo</a></h3></header>
<input type="checkbox" value="" name="post_check" class="post-check center-align">
<div class="post-body">Mauris nec nisl justo. Suspendisse quis metus venenatis turpis feugiat euismod ac semper arcu. Vestibulum </div>
<footer>
<div class="links">
<a class="edit button" href="/posts/2/edit">Edit Post</a>
<a rel="nofollow" data-method="delete" class="delete button" href="/posts/2">Delete a Post</a>
<a class="view button" href="/posts/2">View</a>
</div>
</footer>
</article>
$(".short-post").click(function(evt) {
var $checkbox;
if (evt.target.type !== "checkbox") {
$checkbox = $(":checkbox", this);
$checkbox.attr("checked", !$checkbox.attr("checked"));
evt.stopPropagation();
return false;
}
});