Reputation: 1134
I am trying to remove red border after making empty input-box,
How can I make this.
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" id="test" value="123" required="required">
<input type="button" value="Click me" onClick="$('#test').val('');">
Upvotes: 3
Views: 541
Reputation: 5049
Add this css:
Check in firefox, you will get result;
:not(output):-moz-ui-invalid {
box-shadow: 0 0 0 1px black;
}
:not(output):-moz-ui-invalid {
box-shadow: 0 0 0 1px black;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" id="test" value="123" required="required">
<input type="button" value="Click me" onClick="$('#test').val('');">
Upvotes: 3
Reputation: 2228
Need to apply some css
<style>
input:required {
box-shadow:none;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" id="test" value="123" required="required">
<input type="button" value="Click me" onClick="$('#test').val('');">
Upvotes: 1