HTMLElement.click()

HTMLElement.click() 메소는 엘리먼트에 마우스 클릭을 시뮬레이션합니다.

지원하는 엘리먼트(<input> 등)에서 click() 이 사용될 때, 엘리먼트의 클릭 이벤트가 실행됩니다. 그 다음, 다큐먼트 트리(또는 이벤트 체인)에서 더 상위의 엘리먼트로 버블링되며 상위 엘리먼트의 클릭 이벤트를 실행합니다.

구문

element.click()

명세

명세 상태 코멘트
Document Object Model (DOM) Level 2 HTML Specification Obsolete 초기 정의.

브라우저 호환성

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
click()Chrome Full support 9
Notes
Full support 9
Notes
Notes Before Chrome 19, click() is only defined on buttons and inputs.
Edge Full support 12Firefox Full support 3
Notes
Full support 3
Notes
Notes Before Firefox 5, click() is only defined on buttons and inputs, and has no effect on text and file inputs.
Notes Starting in Firefox 75, the click() function works even when the element is not attached to a DOM tree.
IE Full support 8Opera Full support 10.5Safari Full support 6WebView Android Full support ≤37
Notes
Full support ≤37
Notes
Notes Before Android WebView 4.4, click() is only defined on buttons and inputs.
Chrome Android Full support 18
Notes
Full support 18
Notes
Notes Before Chrome 19, click() is only defined on buttons and inputs.
Firefox Android Full support 5Opera Android Full support 11Safari iOS Full support 6Samsung Internet Android Full support 1.0
Notes
Full support 1.0
Notes
Notes Before Samsung Internet 1.5, click() is only defined on buttons and inputs.

Legend

Full support  
Full support
See implementation notes.
See implementation notes.