Attributes are the special component used inside the tags by developers in order to get the expected output.
Few important attributes are given below
type="number" : To allow only numbers or digts inside input box.
type="password" :To hide the data inside the input box by displaying dots.
type="date" : To allow date containing dd-mm-yyyy format inside the input box.
type="month" : To allow date containing mm-yyyy format inside the input box.
type="radio" : To allow the customers for selecting the one option.
type="checkbox" : To allow the customers for selecting the multiple options.
type="file" : To allow the customers for uploading the different kind of files.
type="reset" : To allow the customers to clear the data given in input boxes.
Note : By default,all the radio buttons can be selected by customers.In order to make radio buttons to behave as single option selector,developers make use of "name" attribute.
Radio buttons with "name" attribute must be specified with same name.
Note : For Required attribute to work,it must be accompanied with the folllowing tags
Submit button
Pattern attribute is used by developers for veryifying the customers data along with developers condition.
Pattern attribute is used with in the input tag by using in this Pattern="[ ] { }" format.
The contents inside the square brackets ([ ]) are considerd as valid.Similarly the number given inside flower brackets ({ }) is the length of the content.
Syntax : Pattern="[6-9]{1}[0-9]{9}"
Note : Pattern attribute works in the program with the help of
Submit button
Min attribute and Max attribute is basically used to provide the restriction on the customers data.
Note : Min and Max attribute will work in the program only if it contains form tag and submit button.
Pattern attribute is used only to check the contents whether data contains numbers or alphabets or special characters whereas min and max attribute is used to keep the restriction on the number data.
Note : Form tag is basically used for four important reasons they are
To make the fields as mandatory with the help of required attribute.
To check or verify the customers data by using pattern attribute.
To keep the restriction on the data given by customer by using min and max attribute.
To clear the data given by the customr by using the type="reset" attribute.
Placeholder attribute is used to create the watermark on the boxes.It can be used as alternative for the label tag.
Textarea tag is used to create larger dimension text box where user can enter more number of characters.