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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:34:49+00:00 2026-05-10T19:34:49+00:00

So I have some html like so: <div id=avatar_choices> <label for=id_choice_0> <input id=id_choice_0 type=radio

  • 0

So I have some html like so:

<div id='avatar_choices'>     <label for='id_choice_0'>         <input id='id_choice_0' type='radio' name='choice' value='7' />         <img src='someimage.jpg' />     </label>     <label for='id_choice_1'>         <input id='id_choice_1' type='radio' name='choice' value='8' />         <img src='someimage2.jpg' />     </label> </div> 

And some script:

$('#avatar_choices input').hide(); $('#avatar_choices img').click(function(){     $('#avatar_choices img').css('border', '2px solid #efefef');     $(this).css('border', '2px solid #39c');     $(this).siblings('input').attr('checked', 'checked'); }); 

The goal is to allow the user to click around on the image options, having the selected one highlight with a border colour.

This works fine in FF. For some reason in IE once I click on an image, click another image, then try to click the first one, the border won’t change (though it does get selected).

EDIT: My solution ended up happening half by accident. I changed the code to this due to redsquare’s answer:

$('#avatar_choices input').hide(); $('#avatar_choices img').click(function(){     $('#avatar_choices img').removeClass('selected');     $(this).addClass('selected');     $(this).siblings('input').attr('checked', 'checked'); }); 

where:

#avatar_choices img.selected{border:2px solid #39c;} 

Go figure.

  • 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. 2026-05-10T19:34:50+00:00Added an answer on May 10, 2026 at 7:34 pm

    best using addClass and removeClass in this scenario. Easier to maintain. Can you paste your full html so I can see your doctype etc

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

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You can tell where methods are being called from by… May 11, 2026 at 12:40 pm
  • added an answer You can use the ']}' command. You may have to… May 11, 2026 at 12:40 pm
  • added an answer Turns out what happens is the DockPanel in the DetailsTemplate… May 11, 2026 at 12:40 pm

Related Questions

So I have some XML in the following format: <somenode> <html xmlns=http://www.w3.org/1999/xhtml> <head> <title/>
So I have run up against this problem a few times: I have some
OK, So i have been watching some MVC vids and reading some bits. I
So I have an object which has some fields, doesn't really matter what. I
I'm placing content on my page through an ajax (post) request like so: $("input#ViewMore").click(function()
I have a third-party app that creates HTML-based reports that I need to display.
I have a wizard-style HTML form with a row of submit buttons for the
I am not very good with Regex but I am learning. I would like

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.