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

  • Home
  • SEARCH
  • 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 8847311
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T12:09:44+00:00 2026-06-14T12:09:44+00:00

I have a simple jQuery Mobile popup like this: <section data-role=popup data-overlay-theme=a id=eat> Are

  • 0

I have a simple jQuery Mobile popup like this:

<section data-role="popup" data-overlay-theme="a" id="eat">
    Are you sure you want to eat?
</section>

And I have multiple links triggering the same popup:

<a href='#eat' data-role='button' data-rel='popup' data-position-to='window' data-food="pizza">Pizza</a>
<a href='#eat' data-role='button' data-rel='popup' data-position-to='window' data-food="sandwich">Sandwich</a>

I’m wondering if there’s any way I can determine which link was clicked to open the popup. I have tried:

$('#eat').on('popupafteropen', function(event) {
    console.log(event);
});

But the console output I have received doesn’t give me any object for the trigger element (unless I’m missing something). Is there a way to do this?

Additional information: I’m trying to populate something else with the value of the data-food attribute on the link. Therefore I need a reference to the <a> element, not the <section> element.

  • 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-14T12:09:45+00:00Added an answer on June 14, 2026 at 12:09 pm

    I added an id for each link

         <a href='#eat' id="pizza"    data-role='button' data-rel='popup' data-position-to='window' data-food="pizza">Pizza</a>
         <a href='#eat' id="sandwich" data-role='button' data-rel='popup' data-position-to='window' data-food="sandwich">Sandwich</a>
    

    and used this script

    <script>
      $('#pizza').on( "click", function() {
        console.log(this);
      });
    
      $('#sandwich').on( "click", function() {
        console.log(this);
      });
    </script>
    

    to get it working, see also jsfiddle

    console after clicking “Pizza”
    enter image description here

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

Sidebar

Related Questions

I have this simple fiddle , which uses jQuery mobile, but it's not working.
I have a simple jquery flipcard animation - http://jsfiddle.net/gGAW5/36/ Now the way this flip
I have pretty simple jquery code : $(document).ready(function(){ $('img.marqFl').on({ mouseenter: function() { $(this).animate({height: 300},
I have this very simple jQuery function: $(.milestone-in-tree).live({ mouseenter: function() { setTimeout( $.ajax({ type:
I have a very simple jQuery script.. all I want it to do is
I've created a simple jQuery Mobile page - have put the relevant sample here:
I have a jquery mobile website that has simple select. I have successfully tested
I have a simple app developed with jQuery Mobile and implemented in PhoneGap. It
I have a very simple .NET MVC3 project set up using jquery mobile for
Trying to do a simple web app with jquery mobile. I have put together

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.