I have a a checkbox:
<div class="checkbox">
<label>
<?= Html::checkbox('chocolate', false) ?>
Chocolate
</label>
</div>
Also I have a span tag:
<span>I like all chocolates.</span>
I want to use the onchange JavaScript function or jQuery (I am beginner using jQuery) to show the span if the user check the checkbox.
First I need to get the value of chocolate. But it is not JavaScript code, it is PHP code: <?= Html::checkbox('chocolate', false) ?>.