Atributo checked de HTML
The HTML checked attribute specifies that an <input> element must be checked when the page loads. See how you can use this attribute on the <input> element.
El atributo checked de HTML es un atributo booleano y especifica que un elemento <input> debe estar marcado cuando se carga la página.
Puedes usar este atributo únicamente en el <input> elemento (<input type="checkbox"> y <input type="radio">).
También es posible establecer el atributo checked después de que la página se haya cargado, mediante JavaScript.
Sintaxis
<input type="checkbox|radio" checked>
<input type="checkbox|radio" checked="checked">Ejemplo del atributo checked de HTML:
Atributo checked de HTML
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<h2>HTML Form Example</h2>
<form action="/form/submit" method="post">
<input type="radio" name="game" value="football" checked /> Football
<input type="radio" name="game" value="basketball" /> Basketball
<input type="submit" value="Submit" />
</form>
</body>
</html>Practice
Práctica
¿Qué hace el atributo 'checked' de HTML?