<!DOCTYPE html> <html> <head> <script src="jquery-1.4.2.min.js"> </script> <script> $(document).ready(function(){ $(".textbox").keypress( function(e){ if (e.keyCode == 13) { if ($(this).index() == 0) { // enter alert("ini enter boz"); } } else { // selain enter } }); }); </script> </head> <body> Textbox: <input type="text" class="textbox"> </body> </html>
untuk source kode silahkan download di sini
No comments:
Post a Comment