Home Python C Language C ++ HTML 5 CSS Javascript Java Kotlin SQL DJango Bootstrap React.js R C# PHP ASP.Net Numpy Dart Pandas Digital Marketing

HTML Input attributes:

In HTML, input attributes are used to define various properties and behaviors of input elements, such as text fields, checkboxes, radio buttons, buttons, etc. Here are some commonly used input attributes:

  1. type: Specifies the type of input element. For example, "text" for a text field, "checkbox" for a checkbox, "radio" for a radio button, "submit" for a submit button, etc.

  2. name: Provides a name for the input element. This name is used when submitting form data to the server.

  3. value: Specifies the initial value of the input element.

  4. placeholder: Defines a placeholder text to be displayed in the input field when it is empty.

  5. required: Indicates that the input field must be filled out before submitting the form.

  6. readonly: Specifies that the input field is read-only and cannot be edited by the user.

  7. disabled: Disables the input element, making it inactive and not selectable.

  8. maxlength: Sets the maximum number of characters that can be entered into a text field.

  9. min and max: Defines the minimum and maximum values for input elements of type "number", "date", etc.

  10. pattern: Specifies a regular expression pattern that the input value must match.

  11. autocomplete: Enables or disables autocomplete functionality for the input field.

  12. autofocus: Specifies that the input field should automatically get focus when the page loads.

These are just a few examples of input attributes in HTML. Each type of input element may have additional attributes specific to its type and purpose.




Advertisement





Q3 Schools : India


Online Complier

HTML 5

Python

java

C++

C

JavaScript

Website Development

HTML

CSS

JavaScript

Python

SQL

Campus Learning

C

C#

java