Let’s say, if I need to assign an id to element with first name, should it be named like:
- firstName
- first-name
- first_name
Which option should I choose (every id I posted above is allowed, but what is the recommended naming)?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is completely up to your taste. I prefer hyphenated ids and classes, because it potentially allows you to use the css3-selector
[att|=val]