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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:26:13+00:00 2026-06-14T00:26:13+00:00

I have these data-attributes <li data-audio= data-pic=images/one.png data-word=one data-hint=What?></li> I pull them through using

  • 0

I have these data-attributes

<li data-audio="" data-pic="images/one.png" data-word="one" data-hint="What?"></li>

I pull them through using this function

$(wordsData).each(function () {
    var elm = $(this);
    listOfWords.push({
        "name": elm.data("word"),
        "pic": elm.data("pic"),
        "hint": elm.data("hint"),
        "audio": elm.data("audio")
    });
});

My problem is that when I pull the picture through I would like to display the hint in the same div. But for some reason when I check in the console it says value=””, when it should say “What?”

<div class="hint-img-wrapper">
<img src="" value="" id="hintPic" class="pic-hint" alt="Hint" />

I display it it like this

 $("#hintPic").attr('src', listOfWords[rndWord].pic).attr('value', listOfWords[rndWord].hint);
        $(hintPic).show();

Can someone tell me what I am doing 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-14T00:26:14+00:00Added an answer on June 14, 2026 at 12:26 am

    What you really want to set instead of .attr('value', listOfWords[rndWord].hint); is .attr('title', listOfWords[rndWord].hint);

    The title property is what’s normally displayed if you hover over an image. If no title is specified it will use the alt property.

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

Sidebar

Related Questions

In my list I have the attributes, data-pic, data-audio and data-word... <li data-audio=sounds/words/black.wav data-pic=images/words/black.png
I have these two data structures that I continually find myself choosing between when
Concerning data binding I have these classes: public class Foo : List<Bar> { public
I have a DataTable which I select from database (Well, these data cross several
I have a set of data with over 1000 entries. I can filter these
I have an Activity with 3 spinners. These spinners get their data from a
I have some data- attributes that I put into a table row tag. When
I have a list in HTML that holds the attributes data-answer and data-sum. The
I have developed iPhone app which contains a 80MB audio files and 20MB images
I have two buttons. Both buttons have two attributes – data-from and data-to. When

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.