I have Two Input name : email and password
I want to give border red color on those input as long empty value when it post by buttton clicked
<div class="form-group first">
<label for="logemail">Email</label>
<input type="text" class="form-control" id="logemail">
</div>
<div class="form-group last mb-3">
<label for="logpasswordpassword">Password</label>
<input type="password" class="form-control" id="logpassword">
</div>
<input type="submit" id="btnlogin" value="Log In" class="btn btn-block btn-primary">
$("#btnlogin").on("click", function () {
$(".input").each(function () {
if ($(this).val().trim() == '')
$(this).css('border-color', 'red');
else
$(this).css('border-color', '');
});
});
my problem is still not working to add border red on :
form-group first and form-group last mb-3