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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T21:26:30+00:00 2026-06-17T21:26:30+00:00

From a language-design standpoint, what’s the point of creating the id attribute for HTML

  • 0

From a language-design standpoint, what’s the point of creating the id attribute for HTML if you can have a class with only one element? Why not just use classes for everything and not complicate the markup?

I can think of three possible explanations, but they don’t fully satisfy me, so I wondered if you know why id was included in HTML. My thoughts are:

  1. The existence of an id helps in creating CSS styles because its greater specificity makes it possible to give an id to one member of a class overriding styles given to other members of that class. This explanation doesn’t fully satisfy me because you could just give it an extra class instead and put the styles for that class at the bottom of the stylesheet in a section for styles given to single elements.
  2. When selecting elements with jQuery, the DOM traversal could stop as soon as the element with that id is found. Thus, the existence of an id would make the selection run faster. This explanation doesn’t satisfy me because I’m fairly certain that jQuery was created long after ids and classes already existed.
  3. Having an id as a language feature could help to ensure that styles (and selectors) which are supposed to be unique truly are applied to only one element because things go haywire when this isn’t the case. This explanation doesn’t satisfy me because having your site break when you accidentally create two elements with the same id doesn’t seem to be a particularly effective way of informing you that something’s gone wrong.
  • 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-06-17T21:26:32+00:00Added an answer on June 17, 2026 at 9:26 pm

    The first publicly available description of HTML was a document called “HTML Tags”, first mentioned on the Internet by Berners-Lee in late 1991.

    There is a description of anchor tag:

    <A NAME=xxx HREF=XXX> ... </A>
    
    HREF
    ...This allows for the form HREF=#identifier to
    refer to another anchor in the same document.
    NAME
    The attribute NAME allows the anchor to be the destination of a link.
    

    I think NAME attribute here is the predecessor of element’s ID: it allowed you to link directly to a desired part of a hypertext page (even if it is the same page).

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

Sidebar

Related Questions

I have some query.i want to translate from one language to another langugae.i am
From language design point of view , What type of practice is supporting operator
I am asking this from a language design point of view. So I am
I'm porting some code from other language to Ruby, in my Class I need
After one week searching and converting many algorithm from other language into php to
What is the best way to design the Domain objects which can have multi-lingual
I have a conceptual Python design dilemma. Say I have a City class, which
I have started to look away from the normal MVC way of creating my
I often have to design client APIs for use by other programmers. The language
From discussions I've had about language design, it seems like a lot of people

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.