blob: 6bcb8b99ff32042092f6f4944e428ef1615826e5 (
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: HTMLSelectElement.checkValidity()
slug: Web/API/HTMLSelectElement/checkValidity
tags:
- API
- Constraint Validation API
- HTML DOM
- HTMLSelectElement
- Referencia
- metodo
translation_of: Web/API/HTMLSelectElement/checkValidity
---
<div>{{ APIRef("HTML DOM") }}</div>
<p>El método <code><strong>HTMLSelectElement.checkValidity()</strong></code> comprueba si el elemento tiene restricciones y si las cumple. Si el elemento no cumple sus restricciones, el navegador lanza un evento cancelable {{event("invalid")}} al momento y luego devuelve <code>false</code>.</p>
<h2 id="Sintaxis">Sintaxis</h2>
<pre class="eval language-html"><code class="language-html">var <em>result</em> = <em>selectElt</em>.checkValidity();</code></pre>
<h2 id="Especificaciones">Especificaciones</h2>
<table class="standard-table">
<tbody>
<tr>
<th scope="col">Especificación</th>
<th scope="col">Estado</th>
<th scope="col">Comentario</th>
</tr>
<tr>
<td>{{SpecName('HTML WHATWG', '#dom-cva-checkvalidity', 'HTMLSelectElement.checkValidity()')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>Sin cambios desde el último snapshot, {{SpecName('HTML5 W3C')}}.</td>
</tr>
<tr>
<td>{{SpecName('HTML5 W3C', 'forms.html#dom-cva-checkvalidity', 'HTMLSelectElement.checkValidity()')}}</td>
<td>{{Spec2('HTML5 W3C')}}</td>
<td>Definición inicial, snapshot de {{SpecName('HTML WHATWG')}}</td>
</tr>
</tbody>
</table>
<h2 id="Compatibilidad_en_navegadores">Compatibilidad en navegadores</h2>
<p>{{Compat("api.HTMLSelectElement.checkValidity")}}</p>
<h2 id="Ver también" name="Ver también">Ver también</h2>
<ul>
<li><a href="/es/docs/HTML/HTML5/Validacion_de_restricciones">Validación de restricciones.</a></li>
</ul>
|