I am faced with a unique challenge. As a user types in an input field, I need to display a reset button positioned center right of the input.
I must adhere to the current HTML structure for the label, input, button, and error message and I prefer not to rely on browser support. Does anyone have a creative solution for achieving this? Thank you in advance.
label {
display: block;
}
.btn {
padding: 10px;
background-color: green;
color: #fff;
}
input {
padding: 10px;
}
<div class="shopping-cart-coupon">
<div class="form-group">
<label for="coupon">Coupon</label>
<input name="coupon" type="text" id="coupon">
<a id="" style="" class="btn" href=''>Activate</a>
<span style="display:block;color:red;">Error message</span>
<a class="reset">x</a>
</div>
</div>