I have an ASP.NET Forms page and there is a fieldset
and inside this there are items that each have a radio button. Basically I want to determine if a certain item is checked. However, it appears that it's location could move and therefore the id
could change if the database is updated. How can I determine if the item is checked using if the id
attribute can change? I don't think the value would change, how can I determine if it is checked by using the value
attribute?
I would like to add a class as suggested but I really only want to use javascript and not change any of the ASP.NET code in the .aspx file.
<fieldset style="padding-left: 5px;">
<input id="ctl00_ctl00_MainContent_ContentPlaceHolder_rblstRole_8" type="radio" name="ctl00$ctl00$MainContent$ContentPlaceHolder$rblstRole" value="36">
<label for="ctl00_ctl00_MainContent_ContentPlaceHolder_rblstRole_8">Agency VP</label>
<br>
<input id="ctl00_ctl00_MainContent_ContentPlaceHolder_rblstRole_9" type="radio" name="ctl00$ctl00$MainContent$ContentPlaceHolder$rblstRole" value="13">
<label for="ctl00_ctl00_MainContent_ContentPlaceHolder_rblstRole_9">Agent</label>
...