Q:

Dynamically generate radio button and get selected radio button ID

Basically what i am trying to do is, I need to generate a set of Radio buttons with respect to the values in a Web Service call and i need to retrieve the selected value whenever a change in the radio button state happens.  I have been successful to generate radio buttons with the values in the response of the API call.  But i am not able to capture the change event in the radio button.  I am trying with KendoUI framework. 
Below is some part of the code that i tried out. 
<div data-role="drawer" id="refineSearchResults" data-position="left" style="width: 50%; background-color: #f5f5f5;" data-swipe-to-open="false">
        <div id="refineHolderDiv" style="height:100%">
            <div style="height:40%">
                <ul data-role="listview" style="background-color:#FFFFFF">
                    <li style="line-height:inherit">
                        <span class="item-title" style="text-align:center">Refine Data</span>
                    </li>
                </ul>
            </div>
            <div id="selctionsForRefinement" style="height:inherit;align-content:space-around">
                <ul style="height:auto;list-style-type:none">
                    <li style="margin-top:5%">
                    <label style="background-color:aliceblue">
                    DIVSION</label></li>
                    <li style="margin-top: 5%">
                        <ul data-role="listview" data-style="inset" data-type="group" id="listView1"></ul>
                    </li>
                    <li style="margin-top: 5%">
                    <label style="background-color:aliceblue">
                        BUSINESS UNIT
                    </label>
                    </li>
                    <li style="margin-top: 5%">
                        <ul data-role="listview" data-style="inset" data-type="group" id="listView2"></ul>
                    </li>
                    <li style="margin-top: 5%"><label style="background-color:aliceblue">AGENCY</label></li>
                    <li style="margin-top: 5%">
                        <ul data-role="listview" data-style="inset" data-type="group" id="listView3"></ul>
                    </li>
                    <li style="margin-top: 5%"><label style="background-color:aliceblue">DEPARTMENT</label></li>
                    <li style="margin-top: 5%">

                        <ul data-role="listview" data-style="inset" data-type="group" id="listView4"></ul>
                            <!--  <select id="multiselect2" multiple="multiple"></select> -->
                    </li>
                </ul>
            </div>
        </div>
        <script>
            var dataSource = new kendo.data. DataSource({
                transport: {
                    read: {
                        url: "http://some_web_link",
                        dataType: "json"
                    }
                }
            });
            $("#listView1").kendoListView({
                dataSource: dataSource,
                template: "<input type=radio name=abc1 onClick=categoryswitch>#:division#</input><br>"
            });
            $("#listView2").kendoListView({
                dataSource: dataSource,
                template: "<input type=radio name=abc2>#:division#</input><br>"
            });
            $("#listView3").kendoListView({
                dataSource: dataSource,
                template: "<input type=checkbox name=abc3 id=#:division# >#:division#</input><br>"
            });
            $("#listView4").kendoListView({
                dataSource: dataSource,
                template: "<input type=checkbox name=abc4 id=#:division#>#:division#</input><br>"
            });
           function categoryswitch(e) {
                alert('test');
            }
            kendo.init($("#listView3"));
        </script>
        </div>

This is the method that i have tried so far.  Please let me know if there is any solution to the problem that i am having.  Also if there is any other alternative to what i am trying out then please let me know. 
Thanks

A:

Please try following changes:
For kendo you can change your id to id='#= YourId HEre #' . 
template: "<input type=radio name=abc1 onClick=categoryswitch>#:division#</input><br>"

To

template: "<input id='1' type='radio' name='abc1' onclick='categoryswitch(event)'>#:division#</input><br>"

and you can get you radio button id by. 
function categoryswitch(e) 
{
    alert(e.target.id);
}

