xxxxxxxxxx
1
<p>
2
Check me!
3
</p>
4
5
<!-- Default unchecked -->
6
<div class="custom-control custom-checkbox">
7
<input type="checkbox" class="custom-control-input" id="defaultUnchecked" onclick="javascript:toggleDiv('id_div_hostname');">
8
<label class="custom-control-label" for="defaultUnchecked">Default unchecked</label>
9
</div>
10
11
12
<div class="md-form" id="id_div_hostname" style="display: none;">
13
<input type="text" name="port1_name" class="form-control" id="id_hostname">
14
<label for="id_hostname" class="disabled">Hostname</label>
15
</div>
1
1
xxxxxxxxxx
1
function toggleDiv(divId) {
2
$("#"+divId).toggle(500);
3
}
4
Console errors: 0