Conditional type field

To clarify a little bit. There are two ways this can be done:

  1. Use a conditional replacement:

    <div id=field>{{^C}}{{type:A}}{{/C}}{{#C}}{{type:B}}{{/C}}</div>
    

    This will require typing A or B, based on whether field C is empty or not (respectively). But arbitrary conditions in the form of cond(c) are impossible.

  2. Use a custom typing HTML element and check the answer explicitly using JS, which will enable using any kind of condition (just as the first method, it can work on any platform).

    I have a template, which has this implemented here. You can use it as a reference for your code, or set up the template itself to work for your purpose (I have a version that I use myself in a way very similar way to what you’ve described). It can also be set up to accept both answers without manually setting any conditions – just type either A or B when reviewing a card, and it will be accepted as correct in both cases.