Set a CSS class on an ASP.NET RadioButtonList ListItem

后端 未结 5 780
一整个雨季
一整个雨季 2020-12-17 08:41

Is there any way to set a CSS class on an input item in a radio button list? I\'d like to reference these form values by class in jQuery.

Given an ASP.NET RadioButto

5条回答
  •  爱一瞬间的悲伤
    2020-12-17 09:02

    Yes, RadioButtonList renders horrible HTML.

    Anyway, it's still easy to get them from jQuery.

    Try

    $('span.myclass input:radio')
    

    Above will get all the radio buttons inside the span with class 'myclass'.

提交回复
热议问题