Run
Reset
Chrome
Cobalt
Monokai
Dreamweaver
Vibrant Ink
<!DOCTYPE html> <html lang="en"> <head> <title>Learning jQuery</title> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script> </head> <body> <p>No Key is pressed until now:</p> <input type="text"/> </body> </html>
/* CSS */
$(document).ready(function(){ let keyp = 1; $('input[type="text"]').keypress(function(){ $('p').text("Total key presses: " + keyp); keyp += 1; }); });