(Input box word counter) HELP NEEDED!

Hello I am somewhat new to twine and I am trying to add a word counter to this twine code.

(set: $Journal to "")
(set: $charLimit to 0)

(set: $Journal to "")
|limitThis1>[(input-box: bind $Journal, "X", 14)]]

<script>
const hook = 'limitThis1';
const element = document.querySelector('tw-hook[name="' + hook.toLowerCase() + '"] textarea');
element.minLength = '200';
    element.maxLength = '786';
    var txt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var len = txt.length;
    element.spellcheck = 'false';
</script>
(set: $string to 'This is a test.')
(set: $wordCount to (words: $string)'s length)
1 Like

Thanks, you are the best :slight_smile:

1 Like