Tags not working in Javascript

I am trying to create a simple code that switched to furigana whenever I have a special tag for the purpose of some words having multiple readings and not being to tell which reading it is, just simply adding furigana overtop. The code is quite simple and it works on my Desktop but not on my phone, does anyone know a fix for this?

<div id='front'>{{kanji:第一語}}</div>

<script>
				var tags = "{{Tags}}";
				if (tags.includes("互い振り仮名(第一)"))
        document.getElementById("front").innerHTML = "{{furigana:第一語}}";
</script>

Would the built-in Ruby capability suffice for what you want to do?

https://docs.ankiweb.net/templates/fields.html#ruby-characters

That’s not what I am looking for, I am trying to get the tags and see what tags I have to use for my script, as you can see above, I make a variable that gets from my {{Tags}} field all the tags, unfortunately, on Ankidroid it doesn’t work, it seems to work in the editor mode for Ankidroid but not when I click on preview or when I use the card itself normally.

It seems like my code actually works, the problem is the Ankidroid previewer itself. When I tested the card itself normally, not the preview, it works properly.

Tracked as:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.