如何在复选框上应用css? [英] how to apply css on checkboxes?

查看:95
本文介绍了如何在复选框上应用css?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<td style="border-style: none; ">
                                <div align="center" class="unchkd" id="seatselect">
                                    <asp:CheckBox ID="A3" runat="server" style="content:seatselect"/>
                                    <asp:CheckBox ID="A4" runat="server" AutoPostBack="True"/>
                                    <asp:CheckBox ID="A5" runat="server" AutoPostBack="True"/>
                                    <asp:CheckBox ID="A6" runat="server" AutoPostBack="True"/>













..... .................................................. ...........................................

亲爱的先生,我想更改背景颜色,但如果未选中复选框,则背景颜色为红色,复选框检查背景颜色是否为此chekcbox的白色。 。

plz help .....







..................................................................................................
dear sir, i want to change background color, but if checkbox is unchecked the background color is red and checkbox is check thene background color is white of this chekcbox...
plz help.....

推荐答案

请参阅以下示例:

假设你有aspx页面正文中的2个复选框:

See the following example:
Let say you have 2 checkboxes in the body of the aspx page:
<asp:CheckBox ID="A5" runat="server" AutoPostBack="false"/>
<asp:CheckBox ID="A6" runat="server" AutoPostBack="false"/>



将以下css和jquery添加到head部分:


Add the following css and jquery to the head section:

<style type='text/css'>
.checkedColor {
    background-color: red;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript">
</script>
<script type="text/javascript">


(function(){
var
(function(){ var


chk =


这篇关于如何在复选框上应用css?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆