Reputation: 33163
Server side asp.net radiobuttonlist. The value for the radiobuttonlist are ints with values 0, 1. The text values are file, url.
So 0=File, 1=URL.
How in jquery can I set this radiobuttonlist value to 0? I tried:
$('#<%=rbAttachmentType.ClientID %>').find("input[value='0']").attr("checked", "checked");
But this did not seem to work.
Upvotes: 3
Views: 10307
Reputation: 388406
You need to use .prop() instead of .attr() to set the checked state
$('#<%=rbAttachmentType.ClientID %>').find("input[value='0']").prop("checked", true);
Upvotes: 9