0

I have an accordion as such: fiddle

The problem is that using removeAttr('checked'); doesn't seem to work. I'm also unsure on how to get the relevant radio ($(this).prev("input") doesn't seem to be the right one)--I know that's a source of the problem, but trying this by selecting a set id (eg. $("#1") doesn't work either. I've also tried using .prop and just plain .checked = false to no avail.

4

1 回答 1

1

你混淆了一些东西......主要问题是你使用的.prev()假设thislabel,而它是containing div. 此外,您必须使用.preventDefault()来阻止radio button再次检查。

jsFiddle 演示

$(this).find("input").prop('checked', false);
e.preventDefault();
于 2013-10-01T18:33:58.420 回答