javascript - event listener for numeric string in any input or textarea? -
trying make greasemonkey script/chrome extension when enter first 4 numbers of credit card, opens new tab porn in distract me instead. me save money.
totally serious way - can done?
here's started:
$(function() { $("html").on("keyup", "input", function() { if(/^\d{4}$/.test(this.value)) { // } }); }); it binds keyup listener input fields (including dynamically-created fields) checks field values 4 digits.
Comments
Post a Comment