我读到按钮类型的隐含值是submit
. 为了制作 UI 按钮,我还读到我们需要指定type=button
属性。
例如:
<button type="button">Click me</button>
但是,我将此示例视为可访问的按钮:
<button aria-label="undo"></button>
我注意到它没有type=button
属性。
如果aria-label
在按钮上定义,是否暗示该按钮属于type=button
?
如果不是,上面的示例(撤消按钮)是否不正确?