Skip to content

pantoken / formats/interactions/src / initCloseButton

함수: initCloseButton()

initCloseButton(btn): void

닫기 버튼을 연결해 해당 대상을 닫습니다.

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