span动态切换
来源:互联网 发布:unity3d 烘焙场景 编辑:程序博客网 时间:2024/05/22 11:53
html部分:
<span class="z_yes" style="float:left;" ><label id="labY" for="z_yes" checked="checked">是</label></span>
<span class="z_fou" style="float:left;"><label id="labN" for="z_no">否</label></span>
<input type="radio" name="active" value="1" id="z_yes" checked="checked" style="display: none"/>
<input type="radio" name="active" id="z_no" value="0" style="display: none"/>
js部分:
if(active==0){
$(".z_yes").attr('style',"float: left; background: rgb(233, 233, 233); color: rgb(151, 151, 151);");
$(".z_fou").attr('style',"float: left; background: rgb(27, 188, 155); color: rgb(255, 255, 255);");
$("#labN").attr('checked',true);
$("#z_fou").attr('checked',true);
}else{
$(".z_fou").attr('style',"float: left; background: rgb(233, 233, 233); color: rgb(151, 151, 151);");
$(".z_yes").attr('style',"float: left; background: rgb(27, 188, 155); color: rgb(255, 255, 255);");
$("#labY").attr('checked',true);
$("#z_yes").attr('checked',true);
}
效果:
- span动态切换
- <span>按钮切换
- DIV和SPAN之间的切换
- span
- span
- span
- SPAN
- Span
- span
- <span>
- span
- span
- span
- 动态新建span,input,select,TABLE 行列
- javascript中怎么给span动态赋值
- <span></span>
- 动态切换窗体风格
- 动态切换图片
- 商品展示2
- 呱哩哗啦下载器,支持文件续传
- win7环境下wireshark编译环境搭建
- html 块状元素和内联元素总结:
- jsp实现单元格对齐
- span动态切换
- 解决Minimum supported Gradle version is 3.3. Current version is 2.14.1问题
- MQ的使用场景
- MiniXml
- android 5.1 如何打开 android.software.managed_users 功能
- 安卓基础TextView跑马灯效果简单实现
- 设计模式之【开篇】
- 4.28
- ubunt16.04安装awscli