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

The Archive Base Latest Questions

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

I need to get the datahours , etc. for the specific clicked link within

  • 0

I need to get the datahours, etc. for the specific clicked link within a long list. What am I missing?

HTML:

<ul>
<li><a href="#" class="item" title="Gallery" datakey="1" datatitle="A+D Gallery" dataaddress="123 Main St" datahours="10:00, 10:30, 11:00, 11:30, 1:00">Gallery</a></li>
<li><a href="#" class="item" title="Radio" datakey="2" datatitle="Radio" dataaddy="321 Center Dr" datahours="11:00, 11:30, 12:00, 12:30, 1:00, 1:30, 2:00, 2:30">Radio</a></li></ul>

JS:

    $(function() {
    var datakey = $(".item").attr("datakey");   
    var datatitle = $(".item").attr("datatitle");
    var dataaddress = $(".item").attr("dataaddress");
    var datahours = $(".item").attr("datahours");

    $(this).click(function(){

        // CONSOLE
        console.log(datakey);

    });

}) // DOM Ready
  • 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-26T18:49:05+00:00Added an answer on May 26, 2026 at 6:49 pm

    How about we do this the jQuery way.

    HTML

    <ul id="items">
        <li><a href="#" class="item" title="Gallery" data-key="1" data-title="A+D Gallery" data-address="123 Main St" data-hours="10:00, 10:30, 11:00, 11:30, 1:00">Gallery</a></li>
        <li><a href="#" class="item" title="Radio" data-key="2" data-title="Radio" data-address="321 Center Dr" data-hours="11:00, 11:30, 12:00, 12:30, 1:00, 1:30, 2:00, 2:30">Radio</a></li>
    </ul>
    

    JavaScript

    $(function()
    {
        $('#items').on('click', 'a.item', function ()
        {
            console.log($(this).data('key'));
            return false;
        });
    });
    

    Demo http://jsfiddle.net/mattball/XBrfH/

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

Sidebar

Related Questions

<div class=myDiv> <p>I need get<strong>this</strong> <a title=And this href=#>but not this</a> </p> <p>And also<strong>This</strong>
i need get protocol(HTTP, FTP, SSMTP, IMAP, ETC) from ip address and port with
$str='<p>http://domain.com/1.html?u=1234576</p><p>http://domain.com/2.html?u=2345678</p><p>http://domain.com/3.html?u=3456789</p><p>http://domain.com/4.html?u=56789</p>'; $str = preg_replace('/.html\?(.*?)/','.html',$str); echo $str; I need get <p>http://domain.com/1.html</p> <p>http://domain.com/2.html</p> <p>http://domain.com/3.html</p> <p>http://domain.com/4.html</p> remove
I have class Errors. I have value errorCode. I need get string by errorCode.
i have PostsController controller and in this controller i need get all user list.
I need get the encoding of a web page(UTF-8,ISO-8859-1,etc) before I download it because
I need get bbish name3 more bbish name4 more $p = '%<a\s+href=my-anchor-name3\s*>(?:.*)</a>%im'; $s =
Just need get some vals located in application.ini(main ini) in the Controller plugin I
I need get all items these have no categories int? categoryId = null; var
I'm working with C#.net developing applications for windows mobile 6, and i need get

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.