bootstrap - 这样改变行间样式对吗?
本文介绍了bootstrap - 这样改变行间样式对吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
问 题
为什么试了不行呢
window.onload=function(){
var oDiv=document.getElementById('div1');
var oIpt=document.getElementById('ipt1');
oIpt.onfocus=function(){
oDiv.style.className='form-group has-error';
}
}
<div class="container" style="
margin-top: 100px;">
<form>
<div class="form-group" id="div1" style="width:45%">
<input type="text" id="ipt1" class="form-control" id="name"
placeholder="请输入用户名">
</div>
</form>
</div>
解决方案
oDiv.className='form-group has-error';
这篇关于bootstrap - 这样改变行间样式对吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文