Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript input prompt example

const firstName = prompt("Siapa nama depanmu?");
const lastName = prompt("Siapa nama belakangmu?");
const language = prompt("Bisa berbahasa apa?");
 
const user = {
   name: {
       first: firstName,
       last: lastName,
   },
   language: language
};
 
if (user.language === "English") {
   alert("Nice to meet you " + user.name.first + " " + user.name.last + "!");
} else if (user.language === "French") {
   alert("Ravi de vous rencontrer " + user.name.first + " " + user.name.last + "!");
} else if (user.language === "Japanese") {
   alert("Hajimemashite, " + user.name.first + " " + user.name.last + "!");
} else {
   alert("Senang bertemu dengan Anda " + user.name.first + " " + user.name.last + "!");
}
Comment

javascript prompts user to input

prompt("your name please")
Comment

PREVIOUS NEXT
Code Example
Javascript :: shallow copy and deep copy in javascript 
Javascript :: javascript map foreach 
Javascript :: spread 
Javascript :: js foreach syntax 
Javascript :: access the prototype of an object javascript 
Javascript :: javascript break with while Loop 
Javascript :: javascript add to a dictionary 
Javascript :: js print 
Javascript :: javascript this = that 
Javascript :: vuejs 
Javascript :: regular function javascript 
Javascript :: js unshift vs push 
Javascript :: process node.js example 
Javascript :: vanilla js 
Javascript :: how to use the javascript console 
Javascript :: monngoose find from an array using in 
Javascript :: unicode in javascript 
Javascript :: convert string to a number javascript 
Javascript :: create react tailwind app 
Javascript :: javascript eliminar saltos de linea textarea 
Javascript :: scarping js 
Javascript :: discord message reply 
Javascript :: upload file in node 
Javascript :: how to validate date in react 
Javascript :: how to sort one element in property javascript 
Javascript :: destructuring nested objects 
Javascript :: variavel javascript 
Javascript :: find element vs find elements 
Javascript :: axios download file from url 
Javascript :: join string js with and at the last item 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =