Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
How to get multiple value in single prompt JavaScript?

How to get multiple values in single prompt JavaScript. Doesn't use the input form

var toText = prompt("From", "Lorem");
var fromText = prompt("To", "Ipsum");
about 4 years ago · Juan Pablo Isaza
3 answers
Answer question

0

You can get only one input using prompt. You will either have to display multiple prompts or implement a custom dialog window which will basically be a form.

about 4 years ago · Juan Pablo Isaza Report

0

window. prompt() instructs the browser to display a dialog with an optional message prompting the user to input some text, and to wait until the user either submits the text or cancels the dialog.- this is from mdn, you need input

about 4 years ago · Juan Pablo Isaza Report

0

You can get multiple values by separating them with commas and using split method like this:


// Input: Hello, World, Lorem

const promptInput = prompt("Enter comma separated values");
const values = promptInput.split(",")
console.log(values)

// Output: ["Hello", "World", "Lorem"]
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!