简体   繁体   English

什么是允许在输入字段中输入数字字符和点的html模式

[英]What is the html pattern to allow numbers characters and dots in input field

I have input field type is text. 我输入的字段类型是文本。

What is the pattern to allow Numbers, characters and Dot(special character) to input field? 允许数字,字符和点(特殊字符)输入字段的模式是什么?

 input[type="text"]:valid{ color:green; } input[type="text"]:invalid{ color:red; } 
 <input type="text" pattern="^[a-zA-Z0-9\\.]*$" value="test1234."> 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM