selector - how to get input type email's value from jquery -
i trying <input type="email" name="mail">
's value jquery
.
i've run validation checking mail
's value
<script> function valid(){ var em = $.trim($('input:email[name=mail]').val()); if(em.length < 5){ alert('please enter email id'); return false; } return true; } </script>
but form still submitting if user left mail
blank.
i've gone through jquery api doc not found selector
email
. why so?
why not present there , how solve problem?
you do:
$.trim($("input[name='mail']").val());
Comments
Post a Comment