$(".textTest input").keyup(function () { if ($(this).val().match(/[^A-Za-z]/ig)) { alert('english detected'); } }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <div class="textTest"> <input type="text"/> </div> I wanna make this input detect English system, so, if I put any alphabet then the script alert the message "english detected".
https://stackoverflow.com/questions/66038740/how-to-make-english-character-detected-in-a-text-field February 04, 2021 at 10:53AM
没有评论:
发表评论