Using text input as event for animations?

Using text input as event for animations?

Like almost everyone says in their questions, I am relatively new to Jquery, not coding though.

I am currently trying to m ake a course coding for children. 
This is an assignment for school.

I want to make a game in which a charachter has to code in a popup window to get past certain obstacles.
for instance: 
when he/she incounters a river, a window will open in which the children are able to code: make(bridge);

I know how to do the animations but I have no idea how to make the window in which people can type, except for the prompt function. 
I rather not use the prompt function, but I dont know what else could be read by jquery and activate an animation.

I also want to leave like an example text in the window or a hint so the children have some idea of what they need to code.

AN ENERMOUS THANKS upfront for everyone that spends the time to respond!