Cloze notes one at a time

The AnKing's Avatar

The AnKing

30 Nov, 2018 05:57 PM

I got this script from itraveller and its amazing for making cloze notes appear one at a time when you click them. Is there any way to add a keyboard shortcut so they open one at a time top to bottom?

<script>
var clozes = document.getElementsByClassName("cloze");
var clr = window.getComputedStyle(clozes[0]).color;
var bg = window.getComputedStyle(clozes[0]).background;
for (i=1; i<clozes.length; ++i) {
  clozes[i].style.background = clr;
  clozes[i].onclick = function() {this.style.background=bg ;}
}
</script>

  1. Support Staff 1 Posted by Damien Elmes on 01 Dec, 2018 04:01 AM

    Damien Elmes's Avatar

    Javascript is supported by the community - I've moved your question to the community section.

  2. 2 Posted by Vit on 04 Dec, 2018 01:21 AM

    Vit's Avatar

Comments are closed, but you can start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac