HTML popovertargetaction 属性
定义和用法
popovertargetaction
属性允许你定义点击按钮时会发生什么。
你可以选择 "show"、"hide" 和 "toggle" 这几个值。
Hello
popovertargetaction
仅在 type="button" 时有效。
如果未指定 popovertargetaction
属性,将使用默认的 "toggle" 值。
适用范围
popovertargetaction
属性可用于以下元素:
元素 | Attribute |
---|---|
<input> | popovertargetaction |
<button> | popovertargetaction |
示例
示例
点击 input 按钮时,popover 元素将显示
<h1 popover id="myheader">Hello</h1>
<input type="button" popovertarget="myheader" popovertargetaction="show" value="Click me!">
自己动手试一试 »
浏览器支持
Attribute | |||||
---|---|---|---|---|---|
popovertargetaction | 114 | 114 | 不支持 | 17 | 100 |