<script>
var grd = function(){
$("input[type='radio']").click(function() {
var previousValue = $(this).attr('previousValue');
var name = $(this).attr('name');
if (previousValue == 'checked') {
$(this).removeAttr('checked');
$(this).attr('previousValue', false);
} else {
$("input[name="+name+"]:radio").attr('previousValue', false);
$(this).attr('previousValue', 'checked');
}
});
};
grd('1');
</script>
<input type="radio" name="1" class="radio">
<input type="radio" name="1" class="radio">
<input type="radio" name="1" class="radio">
<input type="radio" name="1" class="radio">
<br>
<input type="radio" name="2" class="radio">
<input type="radio" name="2" class="radio">
<input type="radio" name="2" class="radio">
<input type="radio" name="2" class="radio">
var grd = function(){
$("input[type='radio']").click(function() {
var previousValue = $(this).attr('previousValue');
var name = $(this).attr('name');
if (previousValue == 'checked') {
$(this).removeAttr('checked');
$(this).attr('previousValue', false);
} else {
$("input[name="+name+"]:radio").attr('previousValue', false);
$(this).attr('previousValue', 'checked');
}
});
};
grd('1');
</script>
<input type="radio" name="1" class="radio">
<input type="radio" name="1" class="radio">
<input type="radio" name="1" class="radio">
<input type="radio" name="1" class="radio">
<br>
<input type="radio" name="2" class="radio">
<input type="radio" name="2" class="radio">
<input type="radio" name="2" class="radio">
<input type="radio" name="2" class="radio">
Nice articel, This article help me very well. Thank you. Also please check my article on my site Know All About Web Tutorial.
ReplyDelete"Dear Admin,
ReplyDeleteI am Jamal Lloyd Johnson. Very informative post! I am thankful to you for providing this unique information.
Jamal Lloyd Johnson
Apollo Management:Mail: 1236 N. Sweetzer Ave, unit 17
West Hollywood, CA 90069
Jamal Lloyd Johnson
Jamal Lloyd Johnson
Jamal Lloyd Johnson
Jamal Lloyd Johnson"
Nice Article, Blog theme is also very user friendly. Tech information is also good on this blog. Also checkout - Magento 2.4 Features
ReplyDeleteThanks
Nice tutorial. I have written a similar tutorial at my site please check it css important
ReplyDeleteYou can also learn Cdn Reactjs, a declarative, efficient, and flexible JavaScript library.
ReplyDelete