-3

i wrote a jquery function using prop to uncheck all checkboxes in my page. it was working fine, but today all of sudden, it is not working. below is my code

$(function() {
            $("#ctl00_ContentPlaceHolder1_chkSelectAll").click(function() {
                if (!$(this).is(":checked")) {
                    $("[id*=chkSelectionColumns] input:checkbox").prop('checked', false); // To uncheck all
                }
                else {
                    $("[id*=chkSelectionColumns] input:checkbox").prop('checked', true); //To check all
                }
            });
        });

i figured out that if i use link to jquery file <script src="jquery/js/jquery-1.8.1.min.js" type="text/javascript"></script> it works where as if i use <script src="jquery/js/jquery-1.5.1.min.js" type="text/javascript"></script>, it does not work.

What is more confusing is few days back it was working with 1.5.1. any body has any idea how it worked with 1.5.1? is Prop specific to 1.8.1?

ernie
  • 6,356
  • 23
  • 28
user1447718
  • 669
  • 1
  • 11
  • 23

1 Answers1

0

According to this jQuery Docs page $.prop() was added in 1.6. For backwards compatibility, you can try to use $.attr() (docs here) instead?

Bryan A
  • 3,598
  • 1
  • 23
  • 29