I want to show a div based on checkbox toggle but my code is not working
C#
Was an equipment involved?and jquery
JavaScript
$(function () {
$("#equipText").hide();
$("#Equip").click(function () {
if ($(this).is(":checked")) {
$("#equipText").show();
}
else {
$("#equipText").hide();
}
});
});

Marius VasileRank #785 · 2.9K reputationPosted Jun 10, 2021, 12:23 PM EDT
Marius VasileRank #785 · 2.9K reputationPosted Jun 10, 2021, 12:27 PM EDT
Actually it is detailed here https://www.bootstraptoggle.com/ in section Event Propagation
Pranam BhatRank #500 · 4.9K reputationPosted Jun 10, 2021, 12:09 PM EDT
There's a some usage/syntax error. Try this out:
http://jsfiddle.net/sDsCM/
Marius VasileRank #785 · 2.9K reputationPosted Jun 10, 2021, 12:11 PM EDT
Thank you Pranam, I saw that solution before but it is not working for me. If I use a simple checkbox is working properly but I have a toggle and that solution is not enough
Pranam BhatRank #500 · 4.9K reputationPosted Jun 10, 2021, 12:25 PM EDT
Have a look at here. The usage of id : https://beginnersbook.com/2019/04/jquery-effects-show-and-hide/