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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -