常用限制input的方法

2021-08-30 03:21:19 字數 533 閱讀 6603

1.取消按鈕按下時的虛線框,在input裡新增屬性值 hidefocus 或者 hidefocus=true

2.唯讀文字框內容,在input裡新增屬性值 readonly

3.防止退後清空的text文件(可把style內容做做為類引用)

4.enter鍵可以讓游標移到下乙個輸入框

5.只能為中文(有閃動)

6.只能為數字(有閃動)

7.只能為數字(無閃動)

57)) event.returnvalue=false" />

8.只能輸入英文和數字(有閃動)

9.遮蔽輸入法

10. 只能輸入 數字,小數點,減號(-) 字元(無閃動)

57)) event.returnvalue=false" />

11. 只能輸入兩位小數,三位小數(有閃動)

57) && event.keycode!=46 && event.keycode!=45 || value.match(/^\d$/) || /\.\d$/.test(value)) " />

常用限制input的方法

1.取消按鈕按下時的虛線框,在input裡新增屬性值 hidefocus 或者 hidefocus true 2.唯讀文字框內容,在input裡新增屬性值 readonly 3.防止退後清空的text文件 可把style內容做做為類引用 4.enter鍵可以讓游標移到下乙個輸入框 5.只能為中文 有...

常用限制 input 的方法

1.取消按鈕按下時的虛線框,在input裡新增屬性值 hidefocus 或者 hidefocus true 2.唯讀文字框內容,在input裡新增屬性值 readonly 3.防止退後清空的text文件 可把style內容做做為類引用 4.enter鍵可以讓游標移到下乙個輸入框 5.只能為中文 有...

常用限制input的方法

1.取消按鈕按下時的虛線框,在input裡新增屬性值 hidefocus 或者 hidefocus true 2.唯讀文字框內容,在input裡新增屬性值 readonly 3.防止退後清空的text文件 可把style內容做做為類引用 4.enter鍵可以讓游標移到下乙個輸入框 5.只能為中文 有...