I’d like to try to return a value entered by the user. For example, I’m asking for his/her name, then he/she would input it in the textbox. The value of the textbox should be displayed. How will I do this?
In Java this is how I did it:
Scanner in = new Scanner(System.in);
String uname;
System.out.print("Enter your name: ");
uname = in.nextLine();
System.out.println("Hello " + uname);
What have you tried so far? It sounds like you’d like to use a JavaScript prompt… here’s a crude example and here some info you should read… https://developer.mozilla.org/en-US/docs/DOM/window.prompt
Update **
from the comment below “No, what I want to do is get the name of the user from this
<input type="text" name="uname" /> and then when the button is clicked it should be displayed in another textbox.” which is different from the original question this is what you want however your original question was misleading…Try this…