What is the use of "autocomplete" attribute in html5 forms.
'autocomplete' attribute allow ( or disallow ) browser form cache capabilities to suggest prefilled fields to user while typing input... https://www.w3schools.com/tags/att_input_autocomplete.asp
'autocomplete' will also work for form fields with generic 'name' attribute: browsers will suggest input previously entered, even if in other web pages. 'autocomplete' is use to suggest previous user entries... to suggest more stuff ( not previously cached on user side ), you'll have to handle this through JS and server side language ( AJAX will be useful to interface between them ) as suggested by @Apel Mahmod ;)
You can probably use 'autocomplete' attribute in both <form> and <input>, but I don't really know, so I can't swear ;P You have to try it yourself, to see how it react in real situation to see... Anyway, this link can provide more detailed technical stuff about it: https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion
'autocomplete' is attribute of <input> AND <form>... I understood your last question as can we use in both at same time: wasn't it?
@Rajeev Jain wrote: << if you don't use the name attribute in <input> tag the autocomplete="on" is not worked. >> Without 'name' attribute, it'll store a lot of field values for all undefined input name reference, and it'll display not appropriate suggestions later... as storing by key/value pair allow to suggest only same type on data for named <input>s ;) So, default behavior sounds more logical to disable always autocomplete feature for undefined name <input>s ^^
can we use autocomplete attribute both in <form> tag and <input> tag
in w3schools.com autocomplete attribute is use inside the <input> tag
@visph one thing is also most important about autocomplete. if you don't use the name attribute in <input> tag the autocomplete="on" is not worked.