I need to show the .nexto button once I have valid text in the input. Each and every field has its own button so the thing is when I get a valid value of input the button associated with the field should show and other input fields buttons should hide. Thank you.
var required = $('input[required]');
required.on('keyup', function(event) {
if (this.value !== "") {
$(this).$('.nexto').show();
} else {
$(this).$('.nexto').hide();
}
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div class="typeform-element" id="fname">
<p><span class="list">1</span>→What's your First Name? *</p>
<div class="input-element">
<input type="text" name="fname" placeholder="Type your answer..." required class="ip-element">
<p class="blinker">|</p>
</div>
<div class="ok-btn">
<a href="#lname" class="nexto">OK ✔</a>
</div>
</div>
<div class="typeform-element" id="lname">
<p><span class="list">2</span>→What's Your Last Name? *</p>
<div class="input-element">
<input type="text" name="lname" placeholder="Type your answer..." required class="ip-element">
<p class="blinker">|</p>
</div>
<div class="ok-btn">
<a href="#email" class="nexto">OK ✔</a>
</div>
</div>