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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:14:13+00:00 2026-05-12T12:14:13+00:00

I need advice on the following HTML: <!– Beginning of ROW !–> <div id="row1">

  • 0

I need advice on the following HTML:

<!-- Beginning of ROW !-->
<div id="row1">
 <div id="entry">
  free
  <span>some text</span>
  <p>DKK</p>
  <input type="radio" name="red<% Response.Write(counter); %>" id="radio" value="0" />
 </div>

 <div id="entry">
  week
  <span></span>
  <p>DKK</p>
  <input type="radio" name="red<% Response.Write(counter); %>" id="radio2" value="75" />
 </div>
</div>
<!-- End of ROW !-->

<!-- Beginning of ROW !-->
<div id="row2">
 .... same as in row 1
</div>
<!-- End of ROW !-->

nth row ..

Here is jQuery:

$("input").click(function() {
     $("input").parent("div").css("background", "url(images/div_bg.png)");
     $(this).parent("div").css("background", "url(images/div_bg_hover.png)");
});

What I’m trying to do: when I select a radio input the div in which it is located should change background and it works perfectly if there is only one row, but for instance if I try to select the value in first row then I select value in second row.

The div in second row where radio input is located changes background as it should but the div in first row reverse itself to other background although input remained checked. Here is what I’m trying to achieve

alt text

And here is what I achieve :

alt text

  • 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-12T12:14:13+00:00Added an answer on May 12, 2026 at 12:14 pm

    What is the purpose of your second line of jquery?

    $("input").parent("div").css("background", "url(images/div_bg.png)");
    

    This is going to reset the background of all the “entry” divs. If I understand your objective correctly I think you want:

    $(this).parent("div").siblings("div.entry").css("background", "url(images/div_bg.png)");
    

    That way only the siblings of the entry you are changing will get their backgrounds reset.

    On a side note, you have multiple divs with the same id, which is not a good idea.

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

Sidebar

Related Questions

Experts - I need some advice in the following scenario. I have a configuration
I need to check whether a string contains any swear words. Following some advice
Wondering if I could get some advice and direction on this following requirement: Need
I need some expect advice on how to handle the following:- I have a
I'd need advice on following situation with Oracle/PostgreSQL: I have a db table with
I need advice on how to change the file formatted following way file1: A
I really need advice on how to do the following. I have tried several
Im starting with XNA and i need an advice about the following. I have
I need advice on what I need to do to make the following two
I need some advice here, I hope somebody can help me. I have 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.