I am trying to make a code that reads a string from the Console
of the browser and assigns the value of the string in the id "txtTextoResposta"
.
To make it more illustrated, I want to do similar to C # , when we do this:
string x = Console.ReadLine();
I tried with ReadLine()
, but it did not work:
var x = readline();
document.getElementById("txtTextoResposta").innerHTML = x;
I've also tried Console.Log
, but it returns an error:
var x = console.log;
document.getElementById("txtTextoResposta").innerHTML = x;
Error:
function log () {[native code]}