Possible Duplicate:
re-firing a click event on a link with jQuery
Is is possible to tigger an anchor link being clicked when checking a checkbox?? Below is my html and jQuery
Html:
<div id="filter-1" class="filter tags">
<ul>
<li class="grey">
<input type="checkbox">
<a title="" href="/collections/mens/grey">Grey</a>
</li>
<li class="all">
<input type="checkbox">
<a title="" href="/collections/mens">All color</a>
</li>
</ul>
</div>
jQuery:
$("input[type='checkbox']").change(function(){
var item=$(this);
if(item.is(":checked"))
{
item.siblings('a').trigger('click');
}
});