How to choose the right input, the type of which is equal to text, email or tel, and if it is equal to redio or checkbox, it is unnecessary to take?
$(".el input[type='text|email|tel']:first").val(); Is it right?
How to choose the right input, the type of which is equal to text, email or tel, and if it is equal to redio or checkbox, it is unnecessary to take?
$(".el input[type='text|email|tel']:first").val(); Is it right?
Looks like a crutch
var a = $('input[type="text"]:first, input[type="email"]:first, input[type="tel"]:first').val(); console.log(a); <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <div class="el"> <input type="checkbox" value="3"> </div> <div class="el"> <input type="text" value="4"> </div> <div class="el"> <input type="email" value="1"> </div> <div class="el"> <input type="tel" value="2"> </div> Source: https://ru.stackoverflow.com/questions/613883/
All Articles