Sunday, November 14, 2021

html tutorial - part 3,5 form attributes

 attributes WITH VALUES (add things between "" to make em work) :

 

value="" - default value of input. might be a number (for example for sliders) or a text (for text input)


size="" - size of input - number which make input bigger


maxlength="" - maximum size of input (number, text...)


min="" max="" - minimum and maximum values possible to put in a form (number)


pattern="" - pattern to validate input using RegEx


placeholder="" - way to setup background text in text/number fields


step="" - restricting jumping after x numbers (number filesd and sliders)


height="" width="" - just setting up size of input (should also work in other html tags, not only input)


autocomplete="" - on or off. allows browser to check spelling in a text field



and now attributes WITHOUT ANY VALUES (just literally copy them to make em work) :


readonly - makes field non-editable


disabled - disables field (difference from readonly - using readonly you able to fetch data placed in field)


multiple - way to allow multiple selection of a thing (like file...)


required - makes field required to send form data


autofocus - make field selected by default



=]

No comments:

Post a Comment