Moving a focus when the input text field reaches a max length

前端 未结 8 1546
北恋
北恋 2020-12-01 03:54

I do have a credit card number form. The number is divided into four parts just as on a real credit card.

I want to add a JavaScript taste to the form where when a u

8条回答
  •  孤街浪徒
    2020-12-01 04:20

    I highly recommend using the Masked Input jQuery Plugin.

    Your usage will look like this:

    $("#CreditCardNumber").mask("9999-9999-9999-9999");
    

    This way you'll have copy-paste and placeholder support.

提交回复
热议问题