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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T06:44:24+00:00 2026-06-08T06:44:24+00:00

I could use some help isolating an element or two and putting them into

  • 0

I could use some help isolating an element or two and putting them into javascript variables. I am still learning how to properly identify things in the DOM, I have to imagine what I am trying to do is possible.

Consider the following:

$('.fancybox').fancybox({
    'autoScale': false,
    'type': 'iframe',
    'padding': 0,
    'closeClick': false,
    helpers: {
        overlay: {
            closeClick: false
        }
    },
    afterShow: function () {
        $("#overlay_content_top").show();
        $("#overlay_content_bottom").show();
    },
    afterClose: function () {
        $("#overlay_content_top").hide();
        $("#overlay_content_bottom").hide();
    }
});

<div class ="example">
<a class="fancybox" href="http://my-iframe.example"><img src="myimage.jpg" width="x" height="y" /></a>
**<span>Important Information I need</span>**
</div>

I need to put the html from .example span into a variable and then apply it to something that is displaying in the fancybox.

So something like this in crazy pseudo code:

var getname = $(this).html('.example span');

$('.inherit_span').html(getname);

I have twenty different items on the page that can be clicked and I dont want to have to generate separate id’s or names for each item, I would rather just grab the html from the span when the fancybox function is called and then apply that name to another element within the lightbox display. Any help appreciated.

  • 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-08T06:44:25+00:00Added an answer on June 8, 2026 at 6:44 am

    You may have the scenario where there are multiple <a> tags with multiple <span> tags after them, in that case use the .next() method within the beforeShow callback like

    beforeShow: function(){
     var getname = $(this.element).next('span').html();
     $('.inherit_span').html(getname);
    }
    

    NOTE: in order to make the variable getname available outside the callback, declare it at the beginning of your script like

    <script>
    var getname;
    .
    .
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a SQL question that I could use some help with. Still somewhat
Learning my way through this stuff and could use some help. I'm trying to
I could use some help initializing the javascript PubNub interface without having to append
I could use some help with expression conversion. I have a method on a
I am really new to Ruby and could use some help with a program.
i have an issue i could use some help with, i have python list
I'm new to SQL and could use some help in creating a database schema
I'm just starting to learn T-SQL and could use some help in understanding what's
I'm using Firebird 2.1. I could use some help creating the following query or
I am a absolute PHP n00b, so i could use some help with a

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.