Madura Harshana
Madura Harshana

Reputation: 1299

Javascript equivalent function for vbscript MsgBox()

I need to convert following function to javascript,

MsgBox("Are you a programmer?",0,"Please answer")

I think I can use confirm("Are you a programmer?")

but I want to know how to add button order there ?

Upvotes: 2

Views: 3604

Answers (1)

Bob
Bob

Reputation: 175

Javascript does not have the custimizability that vbscript does with this function. And yes, it is confirm(). For example,

var choice=confirm("pick a button");
if(choice) alert("you picked ok");
else alert("you picked cancel")

You cannot control what the buttons say like in vbscript.

Upvotes: 2

Related Questions