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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:49:30+00:00 2026-05-26T11:49:30+00:00

I have an id right now which I call on different pages, but never

  • 0

I have an id right now which I call on different pages, but never on the same page so it works. Would the best practice be to make it a class because its being called on different pages, but not more than once on the different page.

For example, say I have my home page. I call the id test once there. then maybe on my about page I call the id test there again. I will never need to call the id test more than once on a page. Should I use an id or class?

  • 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-26T11:49:31+00:00Added an answer on May 26, 2026 at 11:49 am

    Syntactically, there is nothing wrong with using ID so long as you only use that ID once per page. For CSS, that is the purpose of an ID. However, I don’t know if there’s any point unless you intend to also use that ID in JavaScript.

    If you instead use a class, it will provide more flexibility down the road if you end up using the “test” ID more than once per page. I know you don’t intend to now, but you might later.

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

Sidebar

Related Questions

Right now I have this SQL query which is valid but always times out:
We have a script right now which our Windows users run on a Linux
I have a Utils unit in my app which, as of right now, only
I am writing a MVC3 project. Right now I have a table which has
I am writing a MVC3 project. Right now I have a table which has
This is what I have right now for a file residing on the same
Right now I have a table with a few items, each of which has
What I have right now is an animation that starts when I press space:
I actually have right now two questions: 1) What font faces are preferred for
I have this right now: <%= f.select :credit, (0..500) %> This will result 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.