Set a CSS class on an ASP.NET RadioButtonList ListItem

后端 未结 5 786
一整个雨季
一整个雨季 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:12

    the desigeek response is pretty good..

    To get this to work for radiobuttons I had to do this on document.ready()

    $('#<%=radRisksMarginTrading.ClientID  %>_0').addClass("validate[required]");
    $('#<%=radRisksMarginTrading.ClientID  %>_1').addClass("validate[required]");
    

    I'm sure there is a much better way to do it by looping but I need a quick fix for 5 radiobutton lists..

提交回复
热议问题