blob: 70b7d59de979df8762d5fbd992495d08cfadd8c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
---
title: 'Document: selectstart event'
slug: Web/API/Document/selectstart_event
translation_of: Web/API/Document/selectstart_event
---
<div>{{APIRef}}</div>
<div>
<p><a href="/ja/docs/Web/API/Selection">Selection API</a> の <code><strong>selectstart</strong></code> イベントは新しい選択範囲をユーザが指定した際に発火します。</p>
<p>イベントがキャンセルされた場合、選択範囲は変更されません。</p>
</div>
<table class="properties">
<tbody>
<tr>
<th>Bubbles</th>
<td>有効</td>
</tr>
<tr>
<th>Cancelable</th>
<td>有効</td>
</tr>
<tr>
<th>Interface</th>
<td>{{domxref("Event")}}</td>
</tr>
<tr>
<th>Event handler property</th>
<td>{{domxref("GlobalEventHandlers.onselectstart", "onselectstart")}}</td>
</tr>
</tbody>
</table>
<h2 id="例">例</h2>
<pre class="brush: js">// addEventListener version
document.addEventListener('selectstart', () => {
console.log('Selection started');
});
// onselectstart version
document.onselectstart = () => {
console.log('Selection changed.');
};
</pre>
<h2 id="仕様">仕様</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
<tr>
<td>{{SpecName('Selection API', '#selectstart-event', 'selectstart')}}</td>
<td>{{Spec2('Selection API')}}</td>
<td>Initial definition.</td>
</tr>
</tbody>
</table>
<h2 id="ブラウザ互換性">ブラウザ互換性</h2>
<p>{{Compat("api.Document.selectstart_event")}}</p>
<h2 id="参照">参照</h2>
<ul>
<li>{{domxref("Document/selectionchange_event", "selectionchange")}}</li>
</ul>
|