Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

이 문서는 아직 자원 봉사자들이 한국어로 번역하지 않았습니다. 함께 해서 번역을 마치도록 도와 주세요!

An event handler for the select event on the window.

Syntax

window.onselect = funcRef;
  • funcRef is a function.

Example

<html>
<head>

<title>onselect test</title>

<style type="text/css">
.text1 { border: 2px solid red; }
</style>

<script type="text/javascript">

window.onselect = selectText;

function selectText()
{
 alert("select event detected!");
}
</script>
</head>

<body>
<textarea class="text1" cols="30" rows="3">
Highlight some of this text
with the mouse pointer
to fire the onselect event.
</textarea>
</body>
</html>

Notes

The select event only fires when text inside a text input or textarea is selected. The event is fired after the text has been selected.

Specification

Specification Status Comment
WHATWG HTML Living Standard
The definition of 'onselect' in that specification.
Living Standard  

문서 태그 및 공헌자

 이 페이지의 공헌자: cvrebert, teoli, fscholz, kscarfone, Sheppy, ziyunfei, Jabez, Nickolay, Mw22, Rappo
 최종 변경: cvrebert,