Skip to content

pantoken / formats/interactions/src / initCloseButton

फंक्शन: initCloseButton()

initCloseButton(btn): void

किसी बंद करने वाले बटन को उसके लक्ष्य को बंद (dismiss) करने के लिए कनेक्ट करें।

Target resolution (first match wins):

  1. data-close-target="id" — dismiss the element with that id
  2. popovertarget / commandfor — skip; native browser handles it
  3. walk up to the nearest <dialog>, [popover], or [data-dismissible]

Dismiss strategy:

  • <dialog>dialog.close()
  • [popover]el.hidePopover()
  • [data-dismissible] or [open] → remove open attr + fire bubbling close

पैरामीटर

btn

HTMLElement

वापसी

void