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 7494227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:23:09+00:00 2026-05-29T17:23:09+00:00

I know that in HTML4 classes and id cannot start with numbers. I am

  • 0

I know that in HTML4 classes and id cannot start with numbers.

I am coding in HTML 5/php and alot of my ids and classes have just numbers in them that point to a primary key in my database for jquery ajax calls.

I cannot find the documentation for HTML5 classes and id spec. Is it valid in HTML 5 to have class and id names such as,

class="122"
id="13213"

I have ran my output code through w3c conformance checker and all is good, but still I would like confirmation!?

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-29T17:23:11+00:00Added an answer on May 29, 2026 at 5:23 pm

    I’ve researched this thoroughly and wrote about my findings: The id attribute got more classy in HTML5. From that article:

    HTML5 gets rid of the additional restrictions on the id attribute. The only requirements left — apart from being unique in the document — are that the value must contain at least one character (can’t be empty), and that it can’t contain any space characters.

    To target a classname or ID that starts with a digit in CSS or in JavaScript using the Selectors API, you should escape them. For example, to target the element with id="404", you can’t just use #404 — you’d have to escape it as follows:

    #\34 04 {
      background: pink;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a html file that has invoice details I would like to know
I have some HTML that would have elements with multiple classes, and I need
I know that embedding CSS styles directly into the HTML tags they affect defeats
I know that I should put all the html elements in body tag, but
I know that a submit button in HTML can submit a form which opens
I know that CSS can be used to control the presentation of (X)HTML in
I know that I can use $('#myId').load('aPage.html'); to load a page into an element,
I want to open html files from a shell script. I know that Ubuntu
From Android widget screen guidelines, http://developer.android.com/guide/practices/ui_guidelines/widget_design.html , we know that, home screen has 4*4
What libraries/methods do you know of that can do some basic HTML representation in

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.