162
rated 0 times
[
163]
[
1]
/ answers: 1 / hits: 25443
/ 9 Years ago, fri, may 8, 2015, 12:00:00
I want to change the colour of this placeholder after calling mobileValidate().
<input type=text class=form-control name=InputMobile id=Mobile placeholder=Enter Mobile Number onblur=mobileValidate()required>
JavaScript function is
function mobileValidate(){
var x = document.getElementById(Mobile);
if ((x.value).match(re)){
alert(mobile Number is valid);
}
else{
alert(mobile no is not valid);
x.value=;
x.placeholder.style.color=red;
}
}
More From » html