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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:04:27+00:00 2026-05-25T16:04:27+00:00

In writing javascript based apps, I’m often finding that I want to include information

  • 0

In writing javascript based apps, I’m often finding that I want to include information with an element that is not really appropriate as an id or a class, and I am wondering how to best include that structurally/semantically with html. Sometimes I want to contain an association with another element that’s not in an <a> so href is not appropriate. I have been appending a prefix like ‘tooltip_’ or ‘button_’ and then using string manipulation to convert it, but that’s a bit clunky.

So I’m wondering if any attributes are appropriate to use for alternate types of data.

Also curious because I see that with the jQuery plugin qTip, you can set an attribute to pull the tip description from, but if I’m going to have <p> <a> <img> <h2> tags all with tips and ideally set up the same way.. what attribute could I use in that situation?

  • 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-25T16:04:27+00:00Added an answer on May 25, 2026 at 4:04 pm

    If the information is primarily for the JavaScript to interact with, such as storing extra data, attributes prefixed with data- are the way to go. The jQuery library supports this through it’s Data methods.

    For user content, it depends on what the content is, and also on how it is supposed to be used.

    For images, the alt attribute is specifically for holding a textual alternative to the content in the image. A good rule of thumb for this is that all words (that matter) in the image should be in the alt attribute, as well as a description of what the image is depicting. To test yourself on this, turn images off (a number of browser extensions can do this) and read through your page. If it still all makes sense when the alt text replaces the images and you have not lost any information, you are good.

    The title attribute is for holding information that would be appropriate for a tooltip.

    longdesc and figcaption are some other attributes designed for this purpose as well. I would highly recommend a read through the html5 spec if you really want to learn when to use what.

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

Sidebar

Related Questions

One thing I don't like about writing javascript-based applications is that you have to
I'm writing a javascript based photo gallery with a horizontally scrollable thumbnail bar. >>
I'm writing a JavaSCript class that has a method that recursively calls itself. Scheduler.prototype.updateTimer
So I'm writing a Javascript library that takes x,y coordinates and uses them to
I'm writing some Javascript code that generates an XML document in the client (via
I'm writing a Javascript function that would manipulate an array written on-the-fly and sent
I'm writing an application in PhoneGap that I want to run on iOS, Android,
I am very new to Web development, and have been writing some javascript that
I am looking into writing web based games using just Javascript, HTML, and CSS.
I'm writing some documentation that will occasionally include C# or C++ code snippets. 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.