You can have different HTML input elements on a single HTML form and all of them, have their associated remembered values (values that you've entered in those fields); Is it related to the id or name attribute of the input element? No. Proof? Your email address appears on many input elements across different websites, and all those fields have different id and name attributes.

So, there is a mystery here I don't understand. How browsers remember values for HTML form controls? What is the algorithm? How they know that they should show your email on this control and not on that control, while controls are both HTML input type=text elements?

  • It is related to the name attribute. – Rein Henrichs Oct 26 '11 at 7:46
  • Close voter, would you mind please telling us why? Is it an off-topic question? Is it not constructive? What is the reason to vote for closing? – Saeed Neamati Oct 26 '11 at 7:53

Browser are checking for similarity between input elements' name attributes. Also, there are standard names for input fields defined in RFC 3106. Also look here.


Different browsers use different algorithms. I know if I were building one I would wind up

  • checking if the fields name/id has 'email' in it
  • checking if the label text has 'email' in it
  • checking for common abbreviations
  • (if I were google) keeping track of all the forms everyone inputs and seeing which ones get email address looking strings put in them. Since I'm google I can totally do that ;).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.