首页 > 其他分享 >css 设置input选中后样式

css 设置input选中后样式

时间:2022-11-07 11:31:38浏览次数:30  
标签:function color 选中 background input border css

.i_input{ border:#00b5c3 1px solid;}


.i_input:focus {

outline:none;

border: 1px solid red;

}


<input type="text" placeholder=" 输入你真实的姓名" class="i_input">


js-选中切换背景色:

$(document).ready(function(){

$('label').click(function(){

if($(this).children('input').is(":checked")){

$(this).css('background-color','#f7edb8');

$(this).nextAll().css('background-color','#f8fbf9');

$(this).prevAll().css('background-color','#f8fbf9');

}

})

})

标签:function,color,选中,background,input,border,css
From: https://blog.51cto.com/u_15862653/5828369

相关文章