JQuery: Get value of selected radio group when name is an array

jqueryradio-button

I have a group of radio group like below and I am having problems getting the selected/checked value. I think is it because the name is an array. I renamed my id's to the same to see if I could do it that way but no luck.

<input type="radio" name="accounts[1][details][status]" value="1" id="status_1" />
<input type="radio" name="accounts[1][details][status]" value="2" id="status_1" />

Thanks

Best Solution

This should do it. See jQuery docs on escaping special characters.

$('input[name="accounts\\[1\\]\\[details\\]\\[status\\]"]:checked').val();