Client-Side References - Name vs. ID

  • Thread starter Thread starter Felipe
  • Start date Start date
F

Felipe

Learning client-side coding... which should be used to refer to an HTML
control - the ID or the Name attribute? Can both be used interchangeably?
Rationalle for which one to use?

Thanks.
 
Felipe said:
Learning client-side coding... which should be used to refer to an HTML
control - the ID or the Name attribute? Can both be used interchangeably?
Rationalle for which one to use?

The id is what identifies the object in the DOM. The name attribute
determines what gets sent to the server on a form submit, but does not
necessarily identify the object uniquely.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top