Search code examples
htmlformsnaming

Naming convention for the "id" vs "name" attribute on HTML form elements when submitting data


Is there a suggested naming convention for HTML form element IDs vs. the name attribute?

I am referring specifically to when submitting the form and using jQuery.serializeArrays() to capture the data which appears to give {"name":"", "value":""} pairs.


Solution

  • You can find Google's style guide here:

    4.1.2 ID and Class Naming