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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:52:58+00:00 2026-06-13T09:52:58+00:00

I’ve been searching for a very long time without any luck within the subject,

  • 0

I’ve been searching for a very long time without any luck within the subject, please point me in the right direction if I have been missing an older thread.

What I’m trying to achieve:

Having a regular view of multiple nodes and by pressing a button (or whatever) within a node make jQuery interact with this specific node in any way. Ex. make a hidden div appear.

The problems I’m facing are for starters that I’m still finding it hard to work with jQuery together with D7. I’ve been using jQ for a very long time before but when using it together with D7 I’m facing major problems.

And the biggest problem … is that once I get the jQ to work it effects every visible node in the list/feed since im calling the function via a div id or a class. I understand why this is happening but what i can’t figure out is how to get the jQ to make an impact only on the node in which the button is being pressed.

This is what i have so far within my node-template for a specific content-type:

    <script type="text/javascript">                                         
(function ($) {

 $('.up2').click(function () {
        $('.nummer_dark').text(parseInt($('.nummer_dark').text())+1,0).toFixed(2);
   $('.up2').toggle();


      });

       $('.up').one('click', function() {
        $('.flag-link-toggle').click();once();


      });


})(jQuery);

 </script> 

This is just an example where I’m trying to increase the number within a span by pressing an object with the up2-class and toggle a flag by pressing an object with the up-class.

The first code works but the number is increased with decimals ( 2.453, 3.4123 etc) instead of just 1,2,3,4 as i planned. But the main problem is that these both codes are giving effect on every node in the list.. I know this is because every node in the list have the same node-template and thus the same classes but i want to find a solution using the node-id in the jQ.

Any leading answers would save my day! =)

  • 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-13T09:52:59+00:00Added an answer on June 13, 2026 at 9:52 am

    I would make use of the .closest() and .find() methods. This will allow you to locate just the parent node containing the button that was just clicked so you can find and change just the child element of that node. Here is some quick psuedo code showing how it would work.

    $('.up2').click(function() {
        $(this).closest('.node').find('.nummer_dark').text();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Let's say I'm outputting a post title and in our database, it's Hello Y&#8217;all
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.