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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:12:26+00:00 2026-06-18T09:12:26+00:00

i have this code: <nav role=nav id=primary-nav class=overview> <h3 class=section active> <span class=menu-toggle open></span>

  • 0

i have this code:

    <nav role="nav" id="primary-nav" class="overview">
    <h3 class="section active">
        <span class="menu-toggle open"></span>
        <span data-content="the-basics">The Basics</span>
    </h3>
        <ul class="active">
            <li><a href="#" class="nav-link" data-content="0">Introduction</a></li>
            <li><a href="#" class="nav-link" data-content="1">A Chapter in the Zeitgeist Movement</a></li>
        </ul>
    <h3 class="section">
        <span class="menu-toggle"></span>
        <span data-content="setting-up-a-national-chapter">Setting up a National Chapter</span>
    </h3>
    <ul>
        <li><a href="#" class="nav-link" data-content="0">Gathering Volunteers &amp; Social Media</a></li>
    </ul>
</nav>

and this javascript code

  // Load page
  $('a.nav-link').on('click', function( event ) {
      event.preventDefault();
      var $this = $(this);
      var parent = this.parentNode;
      console.log(parent);
      var dataContent = $this.attr("data-content");
      console.log(dataContent);
  });

what is the correct way to get the data-content=”” of the parent H3 span for this specific section, for example i want to return the “the-basics” in the The Basics

any advice much 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-18T09:12:27+00:00Added an answer on June 18, 2026 at 9:12 am
    var dataContent =  $this.closest('ul').prev('h3').find('span[data-content]').data('content'); // the-basics
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code nav { background-color:#600; padding:3px 0; } #menu { list-style: none;
I have this code for my top.phtml file <div class=header-nav-container> <div class=header-nav> <h4 class=no-display><?php
I have this code: <div class=container id=container> <div class=content id=content> <div class='nav'> <ul> <li><a
With this code: <ul class=tabs-nav role=tablist > <li role=tab><a href=#newspane id=tab-newnews>Latest News</a></li> <li role=tab><a
I have this bit of code: $(body.ow-client1 #stage-nav li.nav1 a).addClass(sub-nav-active); $(body.ow-client2 #stage-nav li.nav2 a).addClass(sub-nav-active);
I have this jquery code. //this is the main javascript $(document).ready(function(){ $('nav.menu a').hover( function
I have this navigation menu: <nav id=hoofd_menu> <a href=portfolio/ title=Portfolio target=_self class=fade portfolio>Portfolio</a> <a
I have this code: <header> <div id=title> <img alt=logo src=/Content/logo.gif /> </div> <nav> <ul
I have nav code like this in my HTML file: <div id="center_links"> <ul> <li><a
I have this code to sort an array of objects. The data in the

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.