I need help making a Script for my Card Template that doesn’t show a Field(Furigana) example: まずい whenever it’s the same as another Field(Kanji) example: まずい. I’ve been trying to make something and I came up with this although it doesn’t work.
I tried if ChatGpt can help me(it couldn’t) but it kinda confused me on where exactly i need to enter this Script for it to work.
Card Template:
{{FrontSide}}
<hr id=answer>
<span style="font-size: 28px;" id="furigana">{{Vocabulary-Furigana}}</span><br>
<script>
var furiganaText = document.getElementById('furigana').innerText;
var kanjiText = `{{Vocabulary-Kanji}}`.innerText;
if (kanjiText === furiganaText) { document.getElementById('furigana').style.display = 'none';
}
</script>