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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:15:09+00:00 2026-05-13T07:15:09+00:00

On the following page (see code at end) when I click on the checkbox

  • 0

On the following page (see code at end) when I click on the checkbox “A”, on most browsers, it goes under the horizontal rule, unchecked.
On IE6, it goes under the horizontal rule, but keeps checked.
I would like to have the same behaviour in IE6 as in the other browsers.
I tried to add

$(this).attr({"checked":"unchecked"});

but it is not better.
Any solution?

Here is the code of the page:

<html>
<head>

<title>test check</title>

<script src="shoppinglist_fichiers/jquery-1.js"></script>
<script type="text/javascript">

var toggleItem = function(o, toUnbind, toBind){
    var selector = $(o);
    selector.unbind("click", toUnbind);
    selector.bind("click", toBind);
};

var checkItem = function(){
    toggleItem(this, checkItem, uncheckItem);
    //$(this).attr({"checked":"checked"});
    $("#checked").prepend($(this).parent());
};

var uncheckItem = function(){
    toggleItem(this, uncheckItem, checkItem);
    //$(this).attr({"checked":"unchecked"});
    $("#unchecked").append($(this).parent());
};

$(document).ready(function(){
    $("#checked input").bind("click", uncheckItem);
    $("#unchecked input").bind("click", checkItem);
});

</script>

</head>
<body>
<form id="listForm" action="list" method="post">
<span id="checked">

        <span id="A"> 
        <input autocomplete="off" value="A" name="list" checked="checked" type="checkbox">A<br>
        </span>
</span>
<hr/>
<span id="unchecked">

</span>
</form>

</body>
</html>
  • 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-13T07:15:09+00:00Added an answer on May 13, 2026 at 7:15 am

    In IE6 use the property defaultChecked.

    this should work

    var checkItem = function(){
     toggleItem(this, checkItem, uncheckItem);
     //$(this).attr({"checked":"checked"});
     $(this).attr({"defaultChecked":true});
     $("#checked").prepend($(this).parent());
    };
    
    var uncheckItem = function(){
     toggleItem(this, uncheckItem, checkItem);
     //$(this).attr({"checked":"unchecked"});
     $(this).attr({"defaultChecked":false});
     $("#unchecked").append($(this).parent());
    };
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code will generate a link to the page I want to get
Suppose I have the following CSS rule in my page: body { font-family: Calibri,
I am using the following html page: <html> <head> <title>AJAX Example</title> <meta http-equiv=Content-Type content=text/html;
I have the following in a page e.g. /mypage?myvar=oldvalue $_SESSION['myvar'] = $_GET['myvar']; $myvar =
The following code is implemented in Page_Load event to show SaveFileDialog to the user
I'm using the following in the web page but can't get a response from
Consider the following code: Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
I've got the following JavaScript on my web page... 64 var description = new
I am getting the following error when I post back a page from the
Inside my page, I have the following: <aspe:UpdatePanel runat=server ID=updatePanel> <ContentTemplate> <local:KeywordSelector runat=server ID=ksKeywords

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.