+ 5
To get the length of user input, start by setting a variable to user input (prompt()). Then, to get the length, just use the .length attribute after the variable name, as shown in this example: var x = prompt("Enter something"); document.write(x.length);
22nd Jan 2018, 2:34 AM
Faisal
Faisal - avatar