Switching between to classes

Switching between to classes

I have (thanks with some help) an input field, where the user can search for words.
Now i trying to do something, but cant figure it out, so maybe, some one can help me?

A.t.m. the site shows for each word also an symbol. Now i'm trying so that all the symbols are always hidden at the start. Then when the user search for the a word, i want for that specific word that the symbol appears and then the word disappears.

[example given: the site shows this: " Hello, how are you?", when the user then search for "Hello", i want this to happen; "—, how are you?".      So the word and symbol switches, and then when the next word has been input, the new word would change to the symbol and the previous word would appear again (and that specific symbol would disappear again then) [ "—, how are you?" into "Hello, how — you?" (when are has been search)]]

I can't figure it out to work on specific word only. I have giving every word 2 classes: Woord (base class) and key (key= word that is same as word on screen [ are has classes: "are woord"]

Here is jsfiddle: https://jsfiddle.net/z2agv7Lo/74/

Hopefully someone can help me!