javascript - I can't read strings written by the user -


i not able read characters, strings or numbers. i'm starting learn js , maybe it's easy question cant answer myself. code i'm using is:

var main = function() {     "use strict";     var stdout = require("system").stdout;     var stdin = require("system").stdin;     stdout.write( "what name? " );     var name = stdin.readline();     stdout.writeline( "hello, " + name ); }(); 

thanks , sorry if question quite silly.

vanilla javascript doesn't support "read strings". however, if have html document, grab input text box:

document.getelementbyid('textbox_id').value