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 |