How Do I Set a Form's Content to a Variable

Hey guys, I am working on a project that requires me to set the form’s content to a variable.(As in the mechanism behind Google Translate.So my question is that how do I set a user’s input to a variable.

You can get values of various form controls just by accessing the value property of the node:

document.getElementById('myInput').value

Combine it with event listener and you can get /set / manipulate them as you please.
Here’s a really basic Bin to show you an example:

Thank you very much you solved my dilemma.