HTML <input> Type Attribute Values

HTML <input type=”button”> Example A push button that activates a JavaScript when it is clicked: <input type=”button” value=”Click me” onclick=”msg()”> Try it Yourself HTML <input type=”checkbox”> Example Let the user select one or more options of a limited number of choices: <input type=”checkbox” name=”vehicle1″ value=”Bike”> I have a bike<br> <input type=”checkbox” name=”vehicle2″ value=”Car”> I have a car<br> <input type=”checkbox” name=”vehicle3″ value=”Boat” checked> I have a boat<br> Try it Yourself » HTML <input type=”color”> Example […]

HTML <button> autofocus Attribute

Example A button with autofocus: <button type=”button” autofocus>Click Me!</button> Try it Yourself » Definition and Usage The autofocus attribute is a boolean attribute. When present, it specifies that a button should automatically get focus when the page loads. Browser Support The numbers in the table specify the first browser version that fully supports the attribute. Attribute autofocus […]