Okay, so I am trying to make a div id in a Tumblr theme equal to a {Tag} if the {Tag} is "digital", "canvas" or "paper". So I've been trying this:
{block:TagPage}
    <script>
        function checktag(){
            if({Tag} == "digital" || {Tag} == "canvas" || {Tag} == "paper"}){
                document.GetElementById("tag").setAttribute("id", {Tag});
            }
            else {
                document.GetElementById("tag").setAttribute("id", "generictag");
            }
        }
        checktag();
    </script>
    <div id="tag">
    <!-- Include Post loop here -->
    </div>
    {/block:TagPage}
And It's not working. I have tryied replacing {Tag} in conditionals by the new {PlaintextTag} and It does not work as well. How the variable is stored on Tumblr, isn't the {Tag} already a string? What am I doing wrong here?