Answer the question
In order to leave comments, you need to log in
How to add an asterisk to a placeholder inside an input?
Hello!
How to insert an asterisk?
I found one way, but it's a bit unfinished.
When clicked, it disappears, but if left empty, it does not appear.
<div class="container">
<div class="col-md-4">
<form>
<div class="form-group">
<input type="email" type="email" class="form-control" id="exampleInputEmail1" onclick="hideIcon()" placeholder="Email Address">
</div>
</form>
</div>
</div>
.form-group {
padding: 50px 0;
background-image: url("../img/star.png");
background-repeat: no-repeat;
}
function hideIcon() {
document.getElementById('exampleInputEmail1').style.backgroundImage = 'none';
}
Answer the question
In order to leave comments, you need to log in
I'd say it's a designer's mistake and left the asterisk greyed out.
If it doesn't work, you can do it like this https://jsfiddle.net/Lo33tnbp/
It seems to me, or does your input sin with the absence of name with the redundancy of type ?
js can be used$('input[name=email]').val('e-mail*');
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question