for some reason in this code I am getting an error message $('#emailError').css({'display': 'block', 'background-color': #e35152});
Uncaught SyntaxError: Unexpected token ILLEGAL
I don't know why
here is all the javascript.
function confirmEmail() {
var email = document.getElementById('email').value;
var confirmail = document.getElementById('emailConfirm').value;
if (email != confirmail) {
$('#emailError').css({'display': 'block', 'background-color': #e35152});
//document.getElementById('emailError').style.display = "block";
//document.getElementById('emailError').style.background ='#e35152';
};
};
here is my html
<div class="form-group">
<label>Email *</label>
<input type="email" name="email" class="form-control" required="required">
</div>
<div class="form-group">
<label>Confirm Email *</label>
<input type="email" name="emailConfirm" class="form-control" required="required" onblur="confirmEmail()">
<span id="emailError" style="display: none;">Your emails must match</span>
</div>
#e35152document.getElementById()you need to set the attribute id in the elements id="email" id="emailConfirm"