×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: Text
Posted by: Влад Якуб
Added: Jan 21, 2022 10:34 AM
Views: 389
Tags: no tags
  1. $(document).on("mousedown", "pr-elem", function() {
  2.                         var $radio = $(this).find(":radio");
  3.                         if(!$radio.length)
  4.                                 return;
  5.        
  6.                         if(!$radio.is(":checked"))
  7.                                 return;
  8.        
  9.                         $radio.prop("checked", false);
  10.                         $radio.on("change", function(event) {
  11.                                 event.stopPropagation();
  12.                                 event.preventDefault();
  13.        
  14.                                 $(this).prop("checked", false);
  15.                                 $(this).unbind("change");
  16.                                 $(this).trigger("change");
  17.                         });
  18.                 });