# Hint fields show one by one (incremental reveal/uncovering) with hotkey (js only)

**URL:** <https://forums.ankiweb.net/t/hint-fields-show-one-by-one-incremental-reveal-uncovering-with-hotkey-js-only/13866>\
**Category:** Card Design\
**Created:** [October 3, 2021, 12:29pm UTC](https://forums.ankiweb.net/t/hint-fields-show-one-by-one-incremental-reveal-uncovering-with-hotkey-js-only/13866 "2021-10-03T12:29:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ijgnd](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@ijgnd](https://forums.ankiweb.net/u/ijgnd)\
**Post date:** [October 3, 2021, 12:29pm UTC](https://forums.ankiweb.net/t/hint-fields-show-one-by-one-incremental-reveal-uncovering-with-hotkey-js-only/13866/1 "2021-10-03T12:29:20Z")

</div>

There’s the the add-on [reviewer hint hotkeys](https://ankiweb.net/shared/info/1844908621) by glutanimate that for “g” reveals all hints at once and for “h” only the next hint. Its source code is [here on github](https://github.com/glutanimate/anki-addons-misc/blob/835ad28ec0927067b7acb4cd106e9b136205a838/src/reviewer_hint_hotkeys/reviewer_hint_hotkeys.py#L58). For recent anki versions glutaimate’s add-on needs a small js fix for tts code, see [here](https://forums.ankiweb.net/t/hint-hotkeys-not-working-with-built-in-tts/1771/3).

The problem is that this add-on works generally for all note types and has to be installed on each machine. The unhide code is in js and only the key capturing is made with python.

Is there a short pure, basic js solution that works without any add-ons? Kind of like the minimal cloze show one-by-one solution from @kleinerpirat in [this thread](https://forums.ankiweb.net/t/cloze-one-by-one-uncovering/12584/2) ? With a pure js solution you could have hint-reveal hotkeys for regular note types and cloze reveal keys for clozes …

---

<div class="post-metadata">

**Author:** ![shallash](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/shallash/32/4363_2.png) [@shallash](https://forums.ankiweb.net/u/shallash)\
**Post date:** [October 3, 2021, 1:12pm UTC](https://forums.ankiweb.net/t/hint-fields-show-one-by-one-incremental-reveal-uncovering-with-hotkey-js-only/13866/2 "2021-10-03T13:12:15Z")

</div>

To be added to the front template of your cards. You should be able to change the shortcut to whatever you want.

```javascript
<script>
if (typeof hintClicker_keyUp !== "function") {
  var hintClicker_keyUp = function(e) {
    if (e.key === "h") {
      revealFirstHint();
    } else if (e.key === "g") {
      revealAllHints();
    }
  };
  document.addEventListener("keyup", hintClicker_keyUp, false);
}

function revealFirstHint() {
  var firstHint = document.querySelector("a.hint:not([style])")
  firstHint.click();
}

function revealAllHints() {
  var allHints = document.getElementsByClassName("hint")
  var i;
  for (i = 0; i < allHints.length; i++) {
       allHints[i].click()
  }	
}
</script>

```

---

<div class="post-metadata">

**Author:** ![ijgnd](https://avatars.discourse-cdn.com/v4/letter/i/bbe5ce/32.png) [@ijgnd](https://forums.ankiweb.net/u/ijgnd)\
**Post date:** [October 3, 2021, 1:45pm UTC](https://forums.ankiweb.net/t/hint-fields-show-one-by-one-incremental-reveal-uncovering-with-hotkey-js-only/13866/3 "2021-10-03T13:45:44Z")

</div>

Thank you very much for posting a fully working solution within 30 minutes!

---

<div class="post-metadata">

**Author:** ![Snow](https://sea2.discourse-cdn.com/flex002/user_avatar/forums.ankiweb.net/snow/32/12761_2.png) [@Snow](https://forums.ankiweb.net/u/Snow)\
**Post date:** [January 23, 2023, 8:39am UTC](https://forums.ankiweb.net/t/hint-fields-show-one-by-one-incremental-reveal-uncovering-with-hotkey-js-only/13866/4 "2023-01-23T08:39:46Z")

</div>

Hello, would it be possible to link the show hint function to an already existing anki function (i.e.: show answer), so this js would be compatible with AnkiMobile?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex002/uploads/anki2/original/1X/8f1279ababc5879d54e4838989f606cfe55af8c7.jpeg) [@system](https://forums.ankiweb.net/u/system)\
**Post date:** [May 1, 2023, 7:33am UTC](https://forums.ankiweb.net/t/hint-fields-show-one-by-one-incremental-reveal-uncovering-with-hotkey-js-only/13866/5 "2023-05-01T07:33:18Z")

</div>


