if I have this element in my html code
<input type="text" name="name" placeholder="city">
Why alert doesnt appear if I fill same text into this input?
if ( $("input").val().length > 0) {
alert("X");
}
if I have this element in my html code
<input type="text" name="name" placeholder="city">
Why alert doesnt appear if I fill same text into this input?
if ( $("input").val().length > 0) {
alert("X");
}
Try this
$('input').keyup(function(){
if ($(this).val().length > 0){
alert('hey');
}
});
.on("keyup change mouseup", function(){})