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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:08:18+00:00 2026-05-26T19:08:18+00:00

I’m working with jquery. I have an anchor tag that is generated dynamically in

  • 0

I’m working with jquery. I have an anchor tag that is generated dynamically in xslt. Each anchor has to open a hidden div and pass different values in the onclick event.

In the hidden div i have 2 different buttons, one for cancel the action other for confirm. The idea is: when I click on confirm button the previus anchor (that was clicked before to show the hidden div) gets other style (I use addClass, works fine). I pass the value $(this) on the click function to create a reference and it works well…

The problem: when I click in different anchors (to show the div), the previous was clicked get the new value. For instance, if I click on the “a” button, shows the div, click on cancel (nothing happens thats good), then I click on “b” button and click on confirm, the “a” and “b” gets the style.

I need only show the style on the selected button but don’t have a clear idea how I can do that.

My code:

function showInfo(team, selectName, selectId, temps, thisid){
    //Create a function that will recieves some values            
 var showInfoLink = thisid; //Asigh a new variable the value of thisid ( $(this) )
 showInfoLink.removeClass("highlighted");

 //Show the component
 $("#com_advanceBet").css('z-index' , '1' );

//in the component is a select, it will show the name on the anchor of the selected item                
 $("select").change(function () {
   var str = "";
   $("select option:selected").each(function () {
   str += $(this).text() + " ";
   });
   showInfoLink.html(str);
 })
 .change();

//once i click here the anchor will have this class 
   $('#com_continueBet').click(function(){
   showInfoLink.removeClass('nostyle');
   showInfoLink.addClass('highlighted');

 //hide the component
  $("#com_advanceBet").css('z-index' , '-999999');
  });               
}

This is the anchor:

<a href="#" onclick="showInfo('{$team}', '{$selectName}', '{$selectId}', '{$temps}', $(this) ); " class="nostyle" ><xsl:value-of select="$pt" disable-output-escaping="yes"/><span class="test" style="font-size:0.65em"><xsl:value-of select="$odds" disable-output-escaping="yes"/></span></a>

In the anchor, I pass the $(this) to the function, but for any reason it has the value for all the previus clicked anchors.

  • 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-05-26T19:08:19+00:00Added an answer on May 26, 2026 at 7:08 pm

    I created a mock version of this on jsFiddle: http://jsfiddle.net/dPZJc/6/

    It’s much simplified and appears to be working as it should.

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

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have a French site that I want to parse, but am running into
I'm working with an upstream system that sometimes sends me text destined for HTML/XML
In my XML file chapters tag has more chapter tag.i need to display chapters
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.