functiondisp_alert(){alert("Iamanalertbox!!")} functiondisp_alert(){alert("Iamanalertbox!!")}
欢迎来到天天文库
浏览记录
ID:8976885
大小:45.00 KB
页数:8页
时间:2018-04-13
《javascript基础知识总结(代码篇)》由会员上传分享,免费在线阅读,更多相关内容在应用文档-天天文库。
1、Javascript总结(代码篇)1)Alertbox
2、t">functiondisp_confirm(){varr=confirm("Pressabutton")if(r==true){document.write("YoupressedOK!")}else{document.write("YoupressedCancel!")}}
3、d>functiondisp_prompt(){varname=prompt("Pleaseenteryourname","HarryPotter")if(name!=null&&name!=""){document.write("Hello"+name+"!Howareyoutoday?")}}4、>(4)Callafunction1functionmyfunction(){alert("HELLO")}Bypressingthebutton,afunctionwillbecalled.Thefunctionwillal5、ertamessage.(5)Functionwithanargumentfunctionmyfunction(txt){alert(txt)}Bypressingthebutton,afunctionw6、ithanargumentwillbecalled.Thefunctionwillalertthisargument.(7)Functionwithanargument2functionmyfunction(txt){alert(txt)}7、"IntheMorning">Whenyouclickononeofthebuttons,afunctionwillbecalled.Thefunctionwillalerttheargumentthatispassedtoit.(8)Function_return8、vascript">functionmyFunction(){return("Hello,haveaniceday!")}docu
4、>(4)Callafunction1
Bypressingthebutton,afunctionwillbecalled.Thefunctionwillal
5、ertamessage.
Bypressingthebutton,afunctionw
6、ithanargumentwillbecalled.Thefunctionwillalertthisargument.
7、"IntheMorning">
Whenyouclickononeofthebuttons,afunctionwillbecalled.Thefunctionwillalerttheargumentthatispassedtoit.
8、vascript">functionmyFunction(){return("Hello,haveaniceday!")}
此文档下载收益归作者所有