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

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

#1

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.


#2

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:


#3

Thank you very much you solved my dilemma.