I think you cross posting, but if you want to get input from user in java, there are many way to do it. If you use new java compiler, you can use Scanner class, like:
Scanner scan = new Scanner (System.in);
String userPromt = scan.nextLine();
if you want to get user promt using java script:
prompt('Prompt text to the user','Suggest input for the user to enter')