Answers for "how to use regex in jquery"

2

how to use regex in jquery

jQuery(function () {
    $(".mail").keyup(function () {
        var VAL = this.value;

        var email = new RegExp('^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$');

        if (email.test(VAL)) {
            alert('Great, you entered an E-Mail-address');
        }
    });
});
Posted by: Guest on July-15-2021

Code answers related to "how to use regex in jquery"

Code answers related to "Javascript"

Browse Popular Code Answers by Language