$('.email').blur(function() {
if (!validateEmail($(this).val()) ) {
$(this).removeClass("blur").addClass("focus");
} else {
$(this).removeClass("focus").addClass("blur");
}
})
<input type="email" size="61" class="email"></input>
.focus{border: 1px solid red;outline: none;}
.blur{border: 1px solid #7dc855;outline: none; }
.focus:after{
content: "\00D7";
position: relative;
top: -24px;
left: 500px;
color: red;
}
.blur + label:before{
content: "\2713";
position: relative;
top: -24px;
left:...
How to add a pseudo-element in jquery
from JavaScript http://ift.tt/24mTKAB
via IFTTT
Next
« Prev Post
« Prev Post
Previous
Next Post »
Next Post »
Subscribe to:
Post Comments (Atom)
Out Of Topic Show Konversi KodeHide Konversi Kode Show EmoticonHide Emoticon