如何在HTML中写入输入电话号码的模式属性?

How to write the pattern attribute of an input telephone number in HTML?

问题如下:

我的密码是

<input type="tel" name="telephone" id="telephone" required placeholder="Pattern: 234-567-8910" pattern="">

属性模式要写什么?

输入中的模式将采用正则表达式。您的要求是获得符合要求的正则表达式 [模式:234-567-8910]。

正则表达式为

 pattern="[0-9]{3}-[0-9]{3}-[0-9]{4}"