Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (function($) {
  2.         $.fn.tabChar = function() {
  3.                 $(this).each(function() {
  4.                         var input = $(this);
  5.                         var response = function(event){
  6.                                 if ((event.keyCode||event.which)==9) {
  7.                                         input.val(input.val()+'\t');
  8.                                         return false;
  9.                                 }
  10.                         };
  11.                         input.bind('keydown', response).live('keydown', response);
  12.                 });
  13.         }
  14. })(jQuery);
  15.  
  16. //kullanımı
  17. $('input, textarea').tabChar();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement