Course Content
HTML Forms
HTML forms are an essential part of web development and provide a way for users to input and submit data to a server. Forms allow users to enter data such as text, numbers, checkboxes, radio buttons, and more. When a user submits a form, the data is typically sent to a server for further processing.
0/6
HTML Graphics
HTML provides various ways to incorporate graphics into web pages.
0/2
HTML Media
HTML provides built-in support for embedding and displaying various types of media content on web pages.
0/5
HTML APIs
HTML APIs, also known as browser APIs or web APIs, are a set of interfaces and methods provided by web browsers to interact with and manipulate web content, access device features, and perform various tasks. These APIs are implemented in JavaScript and are accessible to web developers when creating web applications. Here are some commonly used HTML APIs:
0/5
HTML Examples
Creating a Simple Web Page, Adding Links and Images and more
0/4
HTML5 for Free | HTML5 – Unleashing the Potential of Web Development
About Lesson

The HTML input element supports a set of common attributes that can be used to further customize and control form inputs. Here are some commonly used form attributes for the HTML input element:

  1. form attribute:
    The form attribute associates an input field with a specific form using the form’s id. This allows inputs to be outside of the form element but still associated with it.
<form id="myForm">
  <input type="text" name="username" form="myForm">
</form>
  1. required attribute:
    The required attribute specifies that an input field must be filled out before submitting the form.
<input type="text" name="username" required>
  1. readonly attribute:
    The readonly attribute makes an input field read-only, preventing users from modifying its value.
<input type="text" name="username" value="JohnDoe" readonly>
  1. disabled attribute:
    The disabled attribute disables an input field, preventing user interaction and data entry.
<input type="text" name="username" value="JohnDoe" disabled>
  1. maxlength attribute:
    The maxlength attribute specifies the maximum number of characters allowed in an input field.
<input type="text" name="username" maxlength="20">
  1. min and max attributes:
    The min and max attributes define the minimum and maximum values for numeric input fields.
<input type="number" name="age" min="18" max="99">
  1. step attribute:
    The step attribute specifies the increment or decrement value for numeric input fields.
<input type="number" name="quantity" min="1" max="10" step="2">
  1. autofocus attribute:
    The autofocus attribute automatically sets the focus on an input field when the page loads.
<input type="text" name="username" autofocus>
  1. autocomplete attribute:
    The autocomplete attribute controls whether the browser should remember and provide autocomplete suggestions for an input field.
<input type="text" name="email" autocomplete="off">

These are just a few examples of form attributes that can be used with the HTML input element. There are additional attributes available depending on the specific type of input field and desired behavior. It’s important to refer to the HTML specification or relevant documentation for a comprehensive list of input attributes and their usage.

Join the conversation