Home > Web Front-end > JS Tutorial > JavaScript message box effect [implementation code]_javascript skills

JavaScript message box effect [implementation code]_javascript skills

WBOY
Release: 2016-05-16 15:03:30
Original
1226 people have browsed it

Warning box

alert();

Confirmation box

var message=confirm("你喜欢javascript吗");
if(message==true){
  document.write("很好,加油");
}else{
  document.write("js功能强大,要学习哦");
}
Copy after login

Question Box

prompt("text","default value");

var myname=prompt(请输入你的姓名);
if(myname!=null){
  alert("你好"+myname);
}else{
  alert("你好我的朋友");
}
Copy after login

The above JavaScript message box effect [implementation code] is all the content shared by the editor. I hope it can give you a reference, and I hope you will support Script Home.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template