aboutsummaryrefslogtreecommitdiff
path: root/files/zh-cn/web/api/selection/collapsetostart/index.html
blob: c231a4c17ef3ae840d1177414d9486cf0001a4fd (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
---
title: Selection.collapseToStart()
slug: Web/API/Selection/collapseToStart
tags:
  - API
  - Selection
  - 参考
  - 方法
translation_of: Web/API/Selection/collapseToStart
---
<div>{{ ApiRef("DOM") }}{{SeeCompatTable}}</div>

<p><strong><code>Selection.collapseToStart()</code></strong> 方法的作用是取消当前选区,并把光标定位在原选区的最开始处,如果此时光标所处的位置是可编辑的,且它获得了焦点,则光标会在原地闪烁。</p>

<h2 id="语法">语法</h2>

<pre class="syntaxbox"><var><var>sel</var></var>.collapseToStart()
</pre>

<h3 id="参数">参数</h3>

<p><em>无。</em></p>

<h2 id="规范">规范</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">规范</th>
   <th scope="col">状态</th>
   <th scope="col">备注</th>
  </tr>
  <tr>
   <td>{{SpecName('Selection API', '#dom-selection-collapsetostart', 'Selection.collapseToStart()')}}</td>
   <td>{{Spec2('Selection API')}}</td>
   <td>Current</td>
  </tr>
 </tbody>
</table>

<h2 id="浏览器兼容性">浏览器兼容性</h2>



<p>{{Compat("api.Selection.collapseToStart")}}</p>

<h2 id="参见">参见</h2>

<ul>
 <li>此方法所属的接口,{{domxref("Selection")}}</li>
</ul>