HTML <button> popovertargetaction 属性
定义和用法
popovertargetaction
属性允许您定义单击按钮时会发生什么。
您可以选择 "show"、"hide" 和 "toggle" 值。
Hello
如果未指定 popovertargetaction
属性,则将使用默认的 "toggle" 值。
另请参阅:
HTML 参考手册:คุณสมบัติ popup HTML
HTML 参考手册:HTML Button popovertarget 属性
ตัวอย่าง
คลิกที่ปุ่ม จะทำให้ประกายแสดง:
<h1 popover id="myheader">Hello</h1> <button popovertarget="myheader" popovertargetaction="show">กดฉัน!<button>
ภาษา
<button popovertarget="element_id" popovertargetaction="hide|show|toggle">
ค่าของคุณสมบัติ
ค่า | คำอธิบาย | ตัวอย่าง |
---|---|---|
hide | คลิกที่ปุ่ม จะทำให้ประกายซ่อน | |
show | คลิกที่ปุ่ม จะทำให้ประกายแสดง | |
toggle | ค่าเริ่มต้น คลิกที่ปุ่ม จะทำให้ประกายและซ่อนประกายอยู่ระหว่างกัน |
การสนับสนุนโปรแกรมนี้
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
114 | 114 | ไม่สนับสนุน | 17 | 100 |