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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T17:35:30+00:00 2026-05-10T17:35:30+00:00

HTML (or maybe just XHTML?) is relatively strict when it comes to non-standard attributes

  • 0

HTML (or maybe just XHTML?) is relatively strict when it comes to non-standard attributes on tags. If they aren’t part of the spec, then your code is considered non-compliant.

Non-standard attributes can be fairly useful for passing along meta-data to Javascript however. For instance, if a link is suppose to show a popup, you can set the name of the popup in an attribute:

<a href='#null' class='popup' title='See the Popup!'     popup_title='Title for My Popup'>click me</a> 

Alternatively, you can store the title for the popup in a hidden element, like a span:

<style>     .popup .title { display: none; } </style> <a href='#null' title='See the Popup!' class='popup'>     click me     <span class='title'>Title for My Popup</span> </a> 

I am torn however as to which should be a preferred method. The first method is more concise and, I’m guessing, doesn’t screw with search engines and screen readers as much. Conversely, the second option makes storing large amounts of data easier and is thus, more versatile. It is also standards compliant.

I am curious what this communities thoughts are. How do you handle a situation like this? Does the simplicity of the first method outweigh the potential downsides (if there are any)?

  • 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. 2026-05-10T17:35:31+00:00Added an answer on May 10, 2026 at 5:35 pm

    I am a big fan of the proposed HTML 5 solution (data- prefixed attributes). Edit: I’d add that there are probably better examples for the use of custom attributes. For instance, data that a custom application will use that have no analogue in standard attributes (eg. customization for event handlers based on something that can’t necessarily be expressed in a className or id).

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

Sidebar

Ask A Question

Stats

  • Questions 65k
  • Answers 65k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer With NULL you have to use IS or IS NOT.… May 11, 2026 at 11:01 am
  • added an answer LINQ To SQL Compiled Queries basically allow that the translation… May 11, 2026 at 11:01 am
  • added an answer Rules of thumb: Don't manipulate GUI components in arbitrary threads;… May 11, 2026 at 11:00 am

Related Questions

HTML (or maybe just XHTML?) is relatively strict when it comes to non-standard attributes
Is there a utility that will generate html or css for blocks of code
I've noticed that the wmd editor can either output HTML or markdown. Does it
When I save a file with an .htm or .html extension, which one is
We currently send an email notification in plain text or html format. Our environment
I need to find a way to hide HTML Rows (or Tables) from view
What is the way of separating Line-Breaks and Space in MultiLine Textbox or HTML
Background: we have an application that generates reports from HTML (that may or may
I'm not sure if this a settings problem or an HTML problem, but on
For full control of your application, do you prefer a GridView or a HTML

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.