This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GUI Composer : How to read the value from an input field in Javascript

I have an input widget (gc-wdiget-input) with id "input_6".

In a Javascript function, how do I get the value of input_6?

For example, I tried this:

var input = GcWidget.querySelector('#input_6').value;

var s = `Input is ${input}`;

alert(s);

which did not work.  The string is output as "Input is undefined"

Thanks!