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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:11:00+00:00 2026-05-14T05:11:00+00:00

The code below works in FF, Safari, Chrome. But IE is giving me issues.

  • 0

The code below works in FF, Safari, Chrome. But IE is giving me issues.

When a checkbox is checked, I cannot get IE to detect it.

$("#checkbox_ID").change(function(){

   if($('#'+$(this).attr("id")).is(':checked'))
   { 
       var value = "1"; 
   }
   else
   { 
       var value = "0"; 
   } 
   alert(value);

   return false;
});

Simply, I’m not getting that alert popup, as expected.
I’ve even tried it this way:

$("#checkbox_ID").change(function(){

   if( $('#'+$(this).attr("id")'+:checked').attr('checked',false))
   { 
       var value = "1"; 
   } 
   else
   { 
       var value = "0"; 
   } 
   alert(value);

   return false;
});

Here’s the simple checkbox input: <input class="prod" type="checkbox" name="checkbox_ID" id="checkbox_ID" value="1"/>

Anyone know if IE requires a different jquery method? or is my code just off?

  • 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-14T05:11:00+00:00Added an answer on May 14, 2026 at 5:11 am

    As noted by sblom with IE7 and below you need the element to blur for this action to fire, later versions of IE and other browsers don’t need the element to explicitly lose focus, simply changing should fire this event (as shown in my below example).

    I believe that your problem could be that you’re trying to access the ‘value’ variable when it is out of scope.

    $("#checkbox_ID").change(function(){
    var value;
    if($(this).is(':checked'))
    { 
        value = "1"; 
    }
    else
    { 
        value = "0"; 
    } 
    alert(value);
    
    return false; 
    });
    

    Here is a working preview, notice that because you return false at the end of the function it resets the checkbox to its previous value, as you have canceled the effect of the click.

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

Sidebar

Related Questions

My code (Below) works in Internet Explorer, but not in Chrome, Safari or Mozilla
The code below works well in Safari but in Chrome and Firefox the form
the code below works fine but it takes an absolute age to run. How
The example code below works as as a server process. But when I add
I have to code below - works great in IE and Opera, but does
Currently my code below works fine but it's a bit of overkill. In my
Can't seem to figure out why this works in Safari but not in chrome.
My CSS code below is working fine in Chrome, but isn't working in Firefox.
The code below works great. I have a MySQL database that contains book titles
The code below works nicely. Each title in the MySQL table submission is printed

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.