随笔分类 -  javascript

摘要:<!DOCTYPE html> <html> <head> <title>for循环</title> </head> <body> <script type="text/javascript"> // for(初始化条件;结束条件;递增条件){ // run this code // } var i 阅读全文
posted @ 2020-12-21 15:20 *!Walter!* 阅读(90) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html> <head> <title>三元运算</title> </head> <body> <script type="text/javascript"> // (条件) ? run this code : run this code; var isresult 阅读全文
posted @ 2020-12-21 11:01 *!Walter!* 阅读(65) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html> <head> <title></title> </head> <body> <script type="text/javascript"> var weather = 'sunny'; switch(weather){ case 'sunny': alt 阅读全文
posted @ 2020-12-21 10:06 *!Walter!* 阅读(49) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html> <head> <title>逻辑运算符</title> </head> <body> <script type="text/javascript"> var weather = 'sunny'; var temp = 32; if (weather 's 阅读全文
posted @ 2020-12-19 21:19 *!Walter!* 阅读(51) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html> <head> <title>比较运算符</title> </head> <body> <script type="text/javascript"> <!-- :比较数值和类型推荐使用 ==:只比较数值 !==:不等于数值和类型 !=:只比较数值 --> 阅读全文
posted @ 2020-12-19 21:11 *!Walter!* 阅读(74) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html> <head> <title></title> </head> <body> <script type="text/javascript"> var distance = 10; var nowDistance = 5; if (nowDistance<d 阅读全文
posted @ 2020-12-19 21:03 *!Walter!* 阅读(96) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html> <head> <title>数组Array</title> </head> <body> <script type="text/javascript"> <!-- 创建 --> var shoping = ['香蕉','苹果','牛奶']; // ale 阅读全文
posted @ 2020-12-19 21:01 *!Walter!* 阅读(44) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>运算符-算数运算符</title> </head> <body> <script type="text/javascript"> var x = 10; var y = 4; // 阅读全文
posted @ 2020-12-19 20:56 *!Walter!* 阅读(89) 评论(0) 推荐(0)
摘要:<!DOCTYPE html> <html> <head> <title>变量:可理解容器</title> </head> <body> <script type="text/javascript"> <!-- var声明:浏览器才能识别 --> // 变量初始化 var x = 30; // 声明 阅读全文
posted @ 2020-12-19 20:49 *!Walter!* 阅读(58) 评论(0) 推荐(0)