The following code creates a button when you click on it, it reveals a field. I works fine with a basic note but not on a note with multiple fields. What’s wrong with the code?
<button onclick="toggleHiddenField()">Click to Reveal</button>
<div id="hidden-field" class="hidden">{{Front}}</div>
<script>
function toggleHiddenField() {
var hiddenField = document.getElementById("hidden-field");
hiddenField.classList.toggle("hidden");
}
</script>