blob: cb731048306ba47deece3884403034c0c9334311 (
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
|
---
title: BatteryManager.charging
slug: Web/API/BatteryManager/charging
translation_of: Web/API/BatteryManager/charging
---
<div>{{APIRef("Battery API")}}</div>
<p>현재 배터리가 충전중인지를 나타내는 Boolean 값 입니다.</p>
<h2 id="문법">문법</h2>
<pre class="syntaxbox">var <em>charging</em> = battery.charging</pre>
<p><code>charging</code> 변수는 배터리가 충전 중인지의 여부를 가져옵니다. 충전중일경우<code> </code><code>true</code>. 이외에는 <code>false </code>를 가리킵니다.</p>
<h2 id="Example" name="Example">예제</h2>
<h3 id="HTML_Content">HTML Content</h3>
<pre class="brush: html"><div id="charging">(charging state unknown)</div></pre>
<h3 id="JavaScript_Content">JavaScript Content</h3>
<pre class="brush: js; highlight:[3]">navigator.getBattery().then(function(battery) {
var charging = battery.charging;
document.querySelector('#charging').textContent = charging ;
});</pre>
<p>{{ EmbedLiveSample('Example') }}</p>
<h2 id="명세">명세</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Specification</th>
<th scope="col">Status</th>
<th scope="col">Comment</th>
</tr>
</thead>
<tbody>
<tr>
<td>{{SpecName("Battery API")}}</td>
<td>{{Spec2("Battery API")}}</td>
<td>Initial definition</td>
</tr>
</tbody>
</table>
<h2 id="브라우저_호환성">브라우저 호환성</h2>
<p>{{Compat("api.BatteryManager.charging")}}</p>
<h2 id="같이_보기">같이 보기</h2>
<ul>
<li>{{domxref("BatteryManager")}}</li>
<li>{{domxref("Navigator.getBattery")}}</li>
</ul>
|