Easiest way to mask characters in HTML(5) text input

后端 未结 5 1182
广开言路
广开言路 2020-12-28 14:33

Does HTML5 have any kind of text field masking or do I still have to trap onkeydown etc.?

jbabey is right--\"masking\" as in blocking certain illegal ch

5条回答
  •  春和景丽
    2020-12-28 15:08

    Yes, according to HTML5 drafts you can use the pattern attribute to specify the allowed input using a regular expression. For some types of data, you can use special input fields like . But these features still widely lack support or have qualitatively poor support.

提交回复
热议问题