# How to have instant type:answer feedback?

**URL:** <https://forums.ankiweb.net/t/how-to-have-instant-type-answer-feedback/21259>\
**Category:** Card Design\
**Created:** [July 7, 2022, 1:00am UTC](https://forums.ankiweb.net/t/how-to-have-instant-type-answer-feedback/21259 "2022-07-07T01:00:41Z")\
**Posts on this page:** 1\
**Showing post:** 9

<div class="post-metadata">

**Author:** ![kleinerpirat](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/kleinerpirat/32/19863_2.png) [@kleinerpirat](https://forums.ankiweb.net/u/kleinerpirat)\
**Post date:** [July 8, 2022, 5:52pm UTC](https://forums.ankiweb.net/t/how-to-have-instant-type-answer-feedback/21259/9 "2022-07-08T17:52:33Z")

</div>

If you don’t want to see the exact location of the error, this becomes a much simpler matter:

```auto
<script>
  (() => {
   /**
   * Type-in-the-answer live feedback for Anki (vague variant)
   * @author Matthias Metelka | @kleinerpirat
   */
    const input = document.getElementById("typeans");
    const answer = "{{Answer}}";
    input.addEventListener("input", () => {
      input.classList.add("typed");
      input.classList.toggle(
        "correct",
        input.value == answer.substring(0, input.value.length)
      );
    });
  })();
</script>

```

CSS

```auto
#typeans.typed {
  background: red;
}
#typeans.typed.correct {
  background: green;
}

```

---

_[View the full topic](https://forums.ankiweb.net/t/how-to-have-instant-type-answer-feedback/21259)._
