Answer the question
In order to leave comments, you need to log in
How to change the background of a textbox depending on the empty text in it?
Hello. There is a form on boostrap,
<div class="col-md-6">
<div class="form-group">
<label for="form_name">Метка</label>
<input id="val1" type="text" name="val1" class="form-control" placeholder="Метка:" style="background-color: #ADD8E6;">
</div>
</div>
var ta= /*получаем ссылку на textarea */;
if(!ta.value.trim()) {
// ta empty
} else {
}
Answer the question
In order to leave comments, you need to log in
input:placeholder-shown {
border: 1px solid red;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question