Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6206717
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:29:53+00:00 2026-05-24T05:29:53+00:00

As the title suggests, I am afraid to have elements with either id=12 or

  • 0

As the title suggests, I am “afraid” to have elements with either id="12" or class="12".
I know the spec allows this, especially for HTML5, but are there any problems you encountered using this?

In this particular case I have <li> elements that contain months and I want to give them a class name with the month number (e.g. 1 for January) to reference them in JavaScript. And instead of class="1" I do class="mon-1".

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T05:29:54+00:00Added an answer on May 24, 2026 at 5:29 am

    If you’re using HTML4 or XHTML and want your documents to be valid, you cannot use a digit for the id. It will however probably work perfectly fine in most mainstream browsers, since they tend to not break your layout just because of a wrongly named id.

    Problems more often occur due to : or . being inside an id name and trying to select those in JavaScript.

    I would still advise against using only digits for the id, if you’re not using HTML5. Just because it adheres to standards. If you’re using mon-1 as the id, that wouldn’t be a problem either, it is allowed to contain digits, just not start with one.

    If you want to use a class name of: .mon-1 that is perfectly fine anyways, because classes naming-restriction is to not contain a space.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

As the title suggests how could I accomplish this? I have been following a
As the title suggests, I'm using Google App Engine and Django. I have quite
As the title suggests, is there any way to bottom-left align components? An <HBox
As the title suggests I have two models Products And Orders which are actually
As the title suggests, I'm looking for a compare-and-swap implementation, but with greater-than comparison:
Basically, as the Title suggests, are there any open source PHP scripts out there
Well, as the title suggests: I have a storyboard and I want it's animation
As the title suggests, I have built an utility based app. The app consists
Like the title suggests I need to do something like so... $i++;//we all know
As the title suggests, we have a Java (Swing) desktop application, and we'd like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.