jQuery clear input text on focus

前端 未结 3 1493
误落风尘
误落风尘 2021-02-20 06:06

I have this jQuery script:

$(document).ready(function() {
    $(\':input:enabled:visible:first\').focus();
    $(\'.letters\').keyup( function() {
          


        
3条回答
  •  别那么骄傲
    2021-02-20 06:49

    To answer your focus question, yes you can do that:

    $("input").focus(function() {
      this.value = "";
    });
    

    To answer the only allow letters question, this has been asked before.

提交回复
热议问题