functiondisp_alert(){alert("Iamanalertbox!!")} functiondisp_alert(){alert("Iamanalertbox!!")}
欢迎来到天天文库
浏览记录
ID:15410005
大小:45.00 KB
页数:8页
时间:2018-08-03
《javascript基础知识总结(代码篇)》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、Javascript总结(代码篇)1)Alertbox
2、functiondisp_confirm(){varr=confirm("Pressabutton")if(r==true){document.write("YoupressedOK!")}else{document.write("YoupressedCancel!")}}
3、ipttype="text/javascript">functiondisp_prompt(){varname=prompt("Pleaseenteryourname","HarryPotter")if(name!=null&&name!=""){document.write("Hello"+name+"!Howareyoutoday?")}}
4、/html>(4)Callafunction1
Bypressingthebutton,afunctionwillbecalled.Thefunctionwillalertamessage.
5、
Bypressingthebutton,afunctionwithanargumentwi
6、llbecalled.Thefunctionwillalertthisargument.
7、puttype="button"onclick="myfunction('GoodEvening!')"value="IntheEvening">
Whenyouclickononeofthebuttons,afunctionwillbecalled.Thefunctionwillalerttheargumentthatispassedtoit.
8、unction(){return("Hello,haveaniceday!")}
此文档下载收益归作者所有