本文介绍了添加错误红色边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想知道如何添加红色边框
js
im wondering how am i going to add in the red border
js
var fullname_msg = 'Please enter your name here!';
$("#fullname").keyup(function(){
("#fullname",fullname_msg)
});
html
html
<input class="inputText" type="text" id="fullname" name="fullname" value="" placeholder="NAME" />
CSS
CSS
.error {
border:2px solid #ef716d !important;
}
i试过 js
--- -------------------------------------
i tried js
----------------------------------------
var fullname_msg = 'Please enter your name here!';
$("#fullname").keyup(function(){
("#fullname",fullname_msg)
});
$("#fullname").css('border-color', 'red');
-------------------------- ----
------------------------------
var fullname_msg = 'Please enter your name here!';
$("#fullname").keyup(function(){
("#fullname",fullname_msg)
});
$("#fullname").addClass('error');
这些都不起作用我不知道为什么?
all these are not working i not sure why?
推荐答案
html
html
<input class="inputText" type="text" id="fullname" name="fullname" value="" placeholder="NAME" />
CSS
CSS
.error {
border:2px solid #ef716d !important;
}
i试过 js
--- -------------------------------------
i tried js
----------------------------------------
var fullname_msg = 'Please enter your name here!';
------------------------------
------------------------------
var fullname_msg = 'Please enter your name here!';
这篇关于添加错误红色边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!