0

In Internet Explorer, the following code doesn't work if its called a second time

$(e.target).siblings().prev().removeAttr("checked"); 

Please provide all the help you can. Thank you.

mu is too short
  • 426,620
  • 70
  • 833
  • 800
Kumar
  • 49
  • 4

1 Answers1

1

Removing an attribute using javascript will remove the attribute from the element permanently.

You can use $(e.target).siblings().prev().prop("checked", false); instead. This will only update the element instead of permanently altering it.

Without getting too detailed in an already answered question, you can check out this answer on the differences between attr and prop in JQuery. Notably, the checked attribute and property behave in different ways, where the attr potentially reflects the default value while the prop reflects the current value. In most cases (since JQuery 1.6), using .prop() to manipulate element properties is favored.

Community
  • 1
  • 1
Jonathan Michalik
  • 1,492
  • 14
  • 15