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.
有很多关于如何向特定元素添加额外类的说明,但是我将使用什么 dom 元素来添加(例如)pattern="[0-9]*"类的所有输入元素.number?
pattern="[0-9]*"
.number
我是 JavaScript 新手,所以任何方向都有帮助。
$(".number").attr('pattern', '[0-9]*');