blob: f7c76bcf086fc614183e851d968755fe7cee998d (
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
|
---
title: GlobalEventHandlers.oninput
slug: Web/API/GlobalEventHandlers/oninput
translation_of: Web/API/GlobalEventHandlers/oninput
---
<div>{{ApiRef("HTML DOM")}}</div>
<p><span id="result_box" lang="ru"><span>Обработчик события </span></span><a href="/en-US/docs/Web/Events/input"><code>input</code></a><span lang="ru"><span> в окне.</span> <span>Событие ввода возникает при изменении значения элемента {{HTMLElement ("input")}}.</span><br>
<br>
<span>Это событие пузырится.</span> <span>Если он поддерживается в окне, он поддерживается и в {{HTMLElement ("input")}}.</span></span></p>
<h2 id="Example">Example</h2>
<pre class="brush: html"><script>
window.addEventListener('input', function (e) {
console.log("input event detected! coming from this element:", e.target);
}, false);
</script>
<input placeholder="type here and see console.">
</pre>
<h2 id="Specifications">Specifications</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("HTML WHATWG", "forms.html#event-input-input", "oninput")}}</td>
<td>{{Spec2("HTML WHATWG")}}</td>
<td>Initial definition</td>
</tr>
</tbody>
</table>
<h2 id="Browser_compatibility">Browser compatibility</h2>
<p>{{Compat}}</p>
<h2 id="See_also">See also</h2>
<ul>
<li><a class="external" href="http://blog.danielfriesen.name/2010/02/16/html5-browser-maze-oninput-support/">An HTML5 Browser maze, oninput support</a></li>
<li><a class="external" href="http://www.useragentman.com/blog/2011/05/12/fixing-oninput-in-ie9-using-html5widgets/">Fixing oninput in IE Using html5Widgets</a> includes polyfill for IE6-8</li>
<li>Mathias Bynens suggests <a class="external" href="http://mathiasbynens.be/notes/oninput">binding to both input and keydown</a></li>
<li><a class="external" href="http://help.dottoro.com/ljhxklln.php">oninput event | dottoro</a> has notes about bugginess in IE9</li>
<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=312094">Bug 312094 - Add support for <select oninput> </a></li>
</ul>
|