You can use data() to store the previous value of the radio, and then check the current value for this:
$(".GridRadio").click(function() { var lastValue = $(this).data("last-value"); var value = $(this).val(); if (lastValue == value) { alert("Already checked"); } else { alert("Not previously checked"); } $(".GridRadio").data("last-value", ""); $(this).data("last-value", value); });
Script example
If you set the checked attribute on one of the radio stations in HTML when the page loads, add this code to set the data for this particular one:
$(".GridRadio:checked").data("last-value", $(".GridRadio:checked").val())
source share