HTML CSS examples for HTML Tag:input
The checked attribute is a boolean attribute to set if an <input> element should be pre-selected checked when the page loads.
The checked attribute can be used with <input type="checkbox"> and <input type="radio">.
In XHTML, the checked attribute must be defined as <input checked="checked" />.
An HTML form with a pre-selected checkbox:
<!DOCTYPE html> <html> <body> <form action="/action_page.php" method="get"> <input type="checkbox" name="vehicle" value="css"> css <br> <input type="checkbox" name="vehicle" value="html" checked> html<br> <input type="submit" value="Submit"> </form><!--from ww w. j a v a2 s . c o m--> </body> </html>