What is the difference between the id
and name
attributes? They both seem to serve the same purpose of providing an identifier.
I would lik
Id : 1) It is used to identify the HTML element through the Document Object Model (via Javascript or styled with CSS). 2) Id is expected to be unique within the page.
Name corresponds to the form element and identifies what is posted back to the server. Example :
The "Last name" field below is outside the form element, but still part of the form.
Last name: