No announcement

Input Form Attributes

Input attributes and input form attributes provide additional information and functionality to the input elements.



<!DOCTYPE html>
    <meta charset="UTF-8">
    <title>Input Attributes Example</title>
    <form name="myForm">
        <input type="text" name="name" placeholder="Name" required>
        <input type="email" name="email" placeholder="Email" autocomplete="off">
        <input type="number" placeholder="Age" name="age" min="18" max="99">
        <input type="checkbox" name="accept" value="1" checked>
        <input type="submit" value="Submit" formaction="/submit-form">
        <input type="reset" value="Reset" form="myForm">


In this example, different attributes such as required, autocomplete, min, max, checked, formaction, and form are used to enforce field requirements, control autocomplete behavior, set input ranges, preselect checkboxes, and customize form submission behavior.