Why does not want to set the checked attribute when selecting a checkbox?
As a result, the display of additional content does not work when the checkbox is selected:
$(document).ready(function() { $("#public").change(function() { if ($(this).attr("checked")) { $('#hide').fadeIn().show(); return; } else { $('#hide').fadeOut(300); } }); }) .ajax_form.af_example { width: 100%;} .control-group { margin: 10px 0;} <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet"/> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script> <div class="container"> <div class="row"> <h1>ΠΠ°ΠΏΠΎΠ»Π½ΠΈΡΠ΅ ΡΠΎΡΠΌΡ</h1> </div> </div> <input type="checkbox" name="public" id="public">ΠΠΊΠ»ΡΡΠΈΡΡ Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡΠ΅Π»ΡΠ½ΡΡ ΠΎΠΏΡΠΈΡ <div id="hide" style="display:none;"> ΠΠΏΠΈΡΠ°Π½ΠΈΠ΅ Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡΠ΅Π»ΡΠ½ΠΎΠΉ ΠΎΠΏΡΠΈΠΈ </div>