jquery - Apply different colors to different items of a RadioButtonList -
i have radiobuttonlist
like:
<asp:radiobuttonlist id="rbl1" runat="server" repeatdirection="horizontal" repeatlayout="flow" selectedvalue='<%#bind("a1") %>'> <asp:listitem runat="server" text="1" value="1" class="radiobuttonlist"></asp:listitem> <asp:listitem runat="server" text="2" value="2" class="radiobuttonlist"></asp:listitem> <asp:listitem runat="server" text="3" value="3" class="radiobuttonlist"></asp:listitem> <asp:listitem runat="server" text="4" value="4" class="radiobuttonlist"></asp:listitem> <asp:listitem runat="server" text="5" value="5" class="radiobuttonlist"></asp:listitem> </asp:radiobuttonlist>
i want apply red color listitem
value
1, yellow listitem
value
2, green listitem
value
3 , on.how do it?
i using asp.net web forms. either jquery or css do.
the problem have more 10 radio button lists. have set color of them have mentioned in question above. each radio button list has different id of them have 5 options. best way accomplish task?
if have ten radiobuttonlist
, want same thing each of can classify each of 5 listitem
, define colors in css. example 2 radiobuttonlist
:
<asp:radiobuttonlist id="rbl1" runat="server" repeatdirection="horizontal" repeatlayout="flow" selectedvalue='<%#bind("a1") %>'> <asp:listitem runat="server" text="1" value="1" class="radiobuttonlist1"/> <asp:listitem runat="server" text="2" value="2" class="radiobuttonlist2"/> <asp:listitem runat="server" text="3" value="3" class="radiobuttonlist3"/> <asp:listitem runat="server" text="4" value="4" class="radiobuttonlist4"/> <asp:listitem runat="server" text="5" value="5" class="radiobuttonlist5"/> </asp:radiobuttonlist>
<asp:radiobuttonlist id="rbl2" runat="server" repeatdirection="horizontal" repeatlayout="flow" selectedvalue='<%#bind("a1") %>'> <asp:listitem runat="server" text="1" value="1" class="radiobuttonlist1"/> <asp:listitem runat="server" text="2" value="2" class="radiobuttonlist2"/> <asp:listitem runat="server" text="3" value="3" class="radiobuttonlist3"/> <asp:listitem runat="server" text="4" value="4" class="radiobuttonlist4"/> <asp:listitem runat="server" text="5" value="5" class="radiobuttonlist5"/> </asp:radiobuttonlist>
and in css:
.radiobuttonlist1{ color:red; } .radiobuttonlist2{ color:yellow; } .radiobuttonlist3{ color:green; } .radiobuttonlist4{ color:magenta; } .radiobuttonlist5{ color:blue; }
Comments
Post a Comment