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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:58:34+00:00 2026-06-17T15:58:34+00:00

I have a problem with nested divs, and jQuery’s click function. Clicking on .header-fb,

  • 0

I have a problem with nested divs, and jQuery’s click function.
Clicking on .header-fb, .header-twitter or .header-linkedin don’t give any results. No errors in console. I’m not sure what’s going on. These classes have background image, not sure, if that makes problem too. Here’s the code:

<div>
 <div id="header-social" class="four columns mobile-two">
 <div class="header-fb"><a href="http://www.facebook.com" >&nbsp</a></div>
 <div class="header-twitter"><a  href="https://twitter.com" >&nbsp</a></div>
 <div class="header-linkedin"><a  href="http://www.linkedin.com/">&nbsp</a></div>
</div>

and javascript:

 <script type="text/javascript">
        jQuery(document).ready(function() {
            jQuery(".header-fb").click(function(){
                  window.location=jQuery(this).find("a").attr("href");
                  return false;
            });
            jQuery(".header-twitter").click(function(){
                window.location=jQuery(this).find("a").attr("href");
                return false;
            });
            jQuery(function() {
                jQuery('.header-linkedin').click(function(){
                    window.location=jQuery(this).find("a").attr("href");
                    return false;
                });
            });
        });
    </script>
  • 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-17T15:58:34+00:00Added an answer on June 17, 2026 at 3:58 pm

    IF your HTML should look like this:

    <div id="header-social" class="four columns mobile-two">
       <div class="header-fb"><a href="http://www.facebook.com" >&nbsp</a></div>
       <div class="header-twitter"><a  href="https://twitter.com" >&nbsp</a></div>
       <div class="header-linkedin"><a  href="http://www.linkedin.com/">&nbsp</a></div>
    </div>
    

    Than you can try with:

    (function( $ ){  // remap $ to jQuery
      $(function(){  // DOM ready shorthand
    
        $('#header-social').on('click','div',function(){
    
           var goTo = $(this).find('a').attr('href');
           window.location = goTo ;
    
        });
    
      });
    })( jQuery );
    

    http://jsbin.com/uxowoj/1/edit

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

Sidebar

Related Questions

I have a problem with a nested lambda function which cannot see a static
I have awkward problem I cannot resolve. I have a nested divs, which I
I have 2 divs nested within a parent div. Im having a problem setting
I have a set of nested DIVs that slidetoggle using jQuery as the user
I have a problem with nested routes which don't display correct url. I use
I have a problem with nested templates and their template specialization. Given the following
I'm having a problem with nested bindings with Knockout.JS For example if I have
I have this problem: After instantiating this Window, open all nested expanders on the
Is it possible to tie nested generics/captures together? I often have the problem of
I have a table with a tags nested inside the td tags. Problem is,

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.