这段代码能输入中文?

print 2002-10-24 01:00:30
<input type="text" name="cargo_weigh" size="20" onKeypress="return (/[\d.]/.test(String.fromCharCode(event.keyCode)))">

我需要只输入数字及空格和-横线的代码,怎么修改呢?

谢谢
...全文
30 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
希默软件 2002-10-24
  • 打赏
  • 举报
回复
<input type="text" name="cargo_weigh" size="20" onKeypress="return (/[\d\- ]/.test(String.fromCharCode(event.keyCode)))">

87,993

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧