JS 20180416作业
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style type="text/css">
*{
margin: auto;
padding: 0px; }
#a1{
width: 1000px;
height: 200px;
border: 1px solid red;
background-color: white;
box-shadow: 8px 8px 8px gray;
margin-top: 10px;
overflow: hidden;
}
#a11{
width: 1000px;
height: 50px;
border: 1px solid red;
line-height: 50px; }
#a2{
width: 1000px;
height: 50px;
border: 1px solid red;
margin-top: 20px;
}
#a21{
width: 150px;
height: 30px;
margin-top: 20px;
margin-left: 50px;
}
#a4{
width: 1000px;
height: 250px;
border: 1px solid red;
background-color: white;
box-shadow: 8px 8px 8px gray;
margin-top: 10px;
overflow: hidden;
}
#a41{
width: 1000px;
height: 50px;
border: 1px solid red;
line-height: 50px; }
#a42{
width: 1000px;
height: 50px;
border: 1px solid red;
margin-top: 20px;
}
#a421{
width: 150px;
height: 30px;
margin-top: 20px;
margin-left: 50px;
}
#a43{
width: 1000px;
height: 50px;
border: 1px solid red;
line-height: 50px;
margin-left: 50px;
}
#a44{
width: 1000px;
height: 50px;
border: 1px solid red;
margin-top: 10px;
}
.a441{
width: 50px;
height: 50px;
border: 1px solid red;
background-color: white;
margin-left: 20px;
float: left;
}
#a5{
width: 1000px;
height: 600px;
border: 1px solid red;
background-color: white;
box-shadow: 8px 8px 8px gray;
margin-top: 10px;
overflow: hidden;
}
#a51{
width: 1000px;
height: 50px;
border: 1px solid red;
line-height: 50px;
margin-left: 20px;
}
#a52{
width: 1000px;
height: 50px;
border: 1px solid red;
margin-top: 20px;
margin-left: 20px; }
#a521{
width: 150px;
height: 30px;
margin-top: 20px;
margin-left: 50px;
}
#a53{
width: 1000px;
height: 50px;
border: 1px solid red;
line-height: 50px;
margin-left: 20px;
}
.a54{
width: 400px;
height: 100px;
border: 1px solid red;
background-color: white;
box-shadow: 8px 8px 8px gray;
margin-top: 20px;
transition: 2s;
}
#a6{
width: 1000px;
height: 200px;
border: 1px solid red;
background-color: white;
box-shadow: 8px 8px 8px gray;
margin-top: 10px;
overflow: hidden;
}
#a61{
width: 1000px;
height: 50px;
border: 1px solid red;
line-height: 50px;
margin-left: 20px;
}
#a62{
width: 1000px;
height: 50px;
border: 1px solid red;
margin-top: 20px;
margin-left: 20px; }
#a63{
width: 1000px;
height: 50px;
border: 1px solid red;
margin-top: 10px;
margin-left: 20px; }
</style>
</head>
<body>
<div id="a1">
<div id="a11">
1、while循环
</div> <div id="a2">
<input type="submit" name="a21" id="a21" value="循环出现提示框5次" onclick="b1()"/>
</div> </div>
<div id="a4">
<div id="a41">
2、for循环
</div>
<div id="a42">
<input type="submit" name="a421" id="a421" value="批量修改样式" onclick="b2()"/>
</div>
<div id="a43">
固定元素个数
</div>
<div id="a44">
<div class="a441"> </div>
<div class="a441"> </div>
<div class="a441"> </div>
<div class="a441"> </div>
</div>
</div>
<div id="a5">
<div id="a51">
if判断for循环
</div>
<div id="a52">
<input type="submit" name="a521" id="a521" value="批量修改样式" onclick="b3()"/>
</div>
<div id="a53">
元素个数不定
</div>
<div class="a54"> </div>
<div class="a54"> </div>
<div class="a54"> </div> </div>
<div id="a6">
<div id="a61">
if判断for循环
</div>
<div id="a62">
<input type="checkbox" name="chk" id="1a" value="2" />
<input type="checkbox" name="chk" id="2b" value="3" />
<input type="checkbox" name="chk" id="3c" value="4" />
<input type="checkbox" name="chk" id="4d" value="6" />
<input type="checkbox" name="chk" id="5e" value="5" />
<input type="checkbox" name="chk" id="6f" value="7" />
</div>
<div id="a63">
<input type="submit" name="qx" id="qx" value="全选" onclick="b4()"/>
<input type="submit" name="a632" id="a632" value="不选" onclick="b5()"/>
<input type="submit" name="a633" id="a633" value="反选" onclick="b6()"/>
</div>
</div>
</body>
</html>
<script type="text/javascript">
function b1(){
for(var i= 0;i<5;i++){
alert("这是第"+i+"弹窗")
}
}
function b2(){
var a421 = document.getElementsByClassName("a441");
for(var i = 0;i<a421.length;i++){
a421[i].style.backgroundColor = "yellow"
}
}
function b3(){
var a521 = document.getElementsByClassName("a54");
/*if(a54.style.background == "white"){*/
for (var i =0;i < a521.length ;i++){
a521[i].style.backgroundColor = "yellow";
a521[i].style.height = "100px";
a521[i].style.width = "500px";
}
/*}*/
/*else{
a521[i].style.width = "400px";
a521[i].style.height = "100px";
a521[i].style.background-color = "white";
}*/
}
function b4 (){
var chk = document.getElementsByClassName("chk");
var qx = document.getElementsByClassName("qx");
for(var i = 0;i<chk.length;i++){
if(qx.checked){
chk[i].checked = true;
}
}
}
</script>
JS 20180416作业的更多相关文章
- js大作业(0)
DAY1:在看HTML5游戏开发实战.手写了一遍乒乓球.自己玩了半小时.实话讲,和本科学的MFC差别不大.通过setInterval函数获取用户的输入 从而允许多用户操作.parseInt把字符串化为 ...
- 百度前端学院js课堂作业合集+分析(更新中...)
第一课:简陋的登录框 <!DOCTYPE html> <html lang="en"> <head> <meta charset=&quo ...
- JS 20180416考试
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- JS 20180415作业
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- JS 20180416课时训练
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...
- 树莓派.使用Node.js来制作一个作业检查仪
先上图 前段时间, 花了点时间给女儿做了个数学习题的小程序 首页 做题界面(题目每次都随机生成, 加减乘除都有) 做题记录 现在问题来了, 怎么才能随时知道作业有没有完成呢? 每次打开做题记录页面刷新 ...
- vue js计算精度问题处理,兼容XP系统
js计算精度问题(浮点数误差,大数计算出错) JavaScript 运算时经常遇到会 0.000000001 和 0.999999999 这样奇怪的结果. 网上教程一大篇,原理请百度,抄作业往下看!! ...
- 分享:计算机图形学期末作业!!利用WebGL的第三方库three.js写一个简单的网页版“我的世界小游戏”
这几天一直在忙着期末考试,所以一直没有更新我的博客,今天刚把我的期末作业完成了,心情澎湃,所以晚上不管怎么样,我也要写一篇博客纪念一下我上课都没有听,还是通过强大的度娘完成了我的作业的经历.(当然作业 ...
- kettle作业中的js如何写日志文件
在kettle作业中JavaScript脚本有时候也扮演非常重要的角色,此时我们希望有一些日志记录.下面是job中JavaScript记录日志的方式. job的js写日志的方法. 得到日志输出实例 o ...
随机推荐
- (11)Spring Boot配置ContextPath【从零开始学Spring Boot】
Spring boot默认是/ ,这样直接通过http://ip:port/就可以访问到index页面,如果要修改为http://ip:port/path/ 访问的话,那么需要在Application ...
- Spring Boot-热部署和Debugger使用(三)
热部署 1.添加热部署pom依赖 <!--热部署插件依赖jar包--> <dependency> <groupId>org.springframework.boot ...
- android 集成支付宝app支付(原生态)-包括android前端与java后台
本文讲解了 android开发的原生态app集成了支付宝支付, 还提供了java后台服务器处理支付宝支付的加密代码, app前端与java后台服务器使用json数据格式交互信息,java后台服务主要用 ...
- javap命令
javap命令 学习了:https://www.cnblogs.com/frinder6/p/5440173.html javap命令查看java类的字节码: 对于synchronized块,可以显示 ...
- CF D. Beautiful numbers (数位dp)
http://codeforces.com/problemset/problem/55/D Beautiful Numbers : 这个数能整除它的全部位上非零整数.问[l,r]之间的Beautifu ...
- u-boot学习(五):u-boot启动内核
u-boot的目的是启动内核.内核位于Flash中,那么u-boot就要将内核转移到内存中.然后执行命令执行之.这些操作是由bootcmd命令完毕的. bootcmd=nand read.jffs2 ...
- python:sql建表语句转换为json
第一种sql格式: CREATE TABLE prpcitem_car ( proposalno ) NOT NULL, itemno ,) NOT NULL, riskcode ) NOT NULL ...
- linux下的开源移动图像监测程序--motion编译与配置【转】
本文转载自:http://www.cnblogs.com/qinyg/p/3355707.html 前几天在网上偶然看到一篇博客,是利用linxu下的开源的motion搭建嵌入式视频动态监控系统,感觉 ...
- nyoj--744--蚂蚁的难题(一)
蚂蚁的难题(一) 时间限制:1000 ms | 内存限制:65535 KB 难度:2 描述 小蚂蚁童鞋最近迷上了位运算,他感觉位运算非常神奇.不过他最近遇到了一个难题: 给定一个区间[a,b],在 ...
- js重定向
在现行的网站应用中URL重定向的应用有很多: 404页面处理.网址改变(t.sina转到weibo.com).多个网站地址(如:http://www.google.com/ .www.g.cn )等: ...