div::after {
content: "X"
width: 10px
height: 10px
position: absolute
top: 50%
left: 50%
transform: translate(-50%, -50%)
}
在输入框后面加个<a id="clearInput" onclick="clearInput()">X</a>
用css调整其位置和文字X的颜色、大小
clearInput()就根据你的需求随便写
<div class="form-group has-error has-feedback"><label class="control-label" for="inputError2">Input with error</label>
<input type="text" class="form-control" id="inputError2" aria-describedby="inputError2Status">
<span class="glyphicon glyphicon-remove form-control-feedback" aria-hidden="true"></span>
<span id="inputError2Status" class="sr-only">(error)</span>
</div>
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)