Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在为 javascript 寻找一个简单的文本框日期掩码“mm/dd/yy”函数。我不需要它依赖于 jquery 或任何其他类型的插件。
任何帮助,将不胜感激。提前致谢。
function validateDate(date) { var re = /^(0[1-9]|1[012])[- \/.](0[1-9]|[12][0-9]|3[01])[- \/.](\d\d)$/; return re.test(date); }