Answer the question
In order to leave comments, you need to log in
How can the script be upgraded?
Help to "upgrade" this script:
$('#input-1').on('keyup',function(){
var $this = $(this),
val = $this.val();
if(val.length >= 1){
$('.label-text').addClass('label-text-active');
}else {
$('.label-text').removeClass('label-text-active');
}
});
<form action="">
<div class="thumb">
<input id="input-1" type="text" placeholder="" required autofocus />
<label for="input-1">
<span class="label-text">Company Name</span>
<span class="nav-dot"></span>
</label>
</div>
<div class="thumb">
<input id="input-2" type="email" placeholder="" required autofocus />
<label for="input-2">
<span class="label-text">Email</span>
<span class="nav-dot"></span>
</label>
</div>
....
</form>
<input id="input-*" />
$('#input-1').on('keyup',function(){
...
});
...
$('#input-6').on('keyup',function(){
...
});
if(val.length >= 1){
$('.label-text').addClass('label-text-active');
}else {
$('.label-text').removeClass('label-text-active');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question