<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript"> confirm("你好");//confirm翻译为确定,证实所以这个是选择的 </script> </head> <body> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript"> function run1() { alert("run"); } setInterval("run()",100); </script> </head> <body> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript"> function str (n,a) { this.name = n; this.age = a; } var p = new str("晨昊","5"); alert(p.name); p.sex = "男"; alert(p.sex); //有两种方法js相比于java来说,语言不需要太高的精度 //在外面直接声明也可以直接套过来使 </script> </head> <body> </body> </html>