if...else
来源:互联网 发布:淘宝童鞋女孩冬季筒靴 编辑:程序博客网 时间:2024/06/07 14:26
if…else 练习
这里写代码片<!DOCTYPE html><html> <head> <meta charset="UTF-8"> <title>if..else</title> <script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script> <style type="text/css"> *{ margin: 0; padding: 0;} .content{ max-width: 900px; height:100%;margin: 0 auto; background-color: #0C4B62; color: #fff;} .scoreBox{ height: 300px; display: flex; align-items: center; } .scoreBox>label{ line-height: 34px;;} .scoreBox>input{ height: 34px; line-height: 34px; padding-left:10px ; margin-right: 20px;} .scoreBox>span{ width:200px; display: inline-block; border-bottom:1px #fff solid ; height: 34px;; line-height: 34px;;} .scoreBox>span:after{ border: 1px #101010 solid; } </style> </head> <body> <div class="content"> <div class="scoreBox"> <label for="">小明的成绩:</label> <input type="number" alt="输入成绩"/> <button onclick="score()">成绩优良</button> <span class="score"></span> </div> <div class="box1"> </div> </div> <script type="text/javascript"> function score(){ var a=$("input[type='number']").val()/1; if(a<=100&&a>=0){ if(a>=90){ $("span").text("成绩为优"); } if(a<90&&a>80){ $("span").text("成绩为良好"); } if( a<=80&&a>60){ $("span").text("成绩为及格"); } if(a<=60){ $("span").text("成绩为不及格"); } } else{$("span").text("请输入0-100之间的数");} } function obj(point){ alert("box的 横坐标为:"+point.x+"box的 纵坐标为:"+point.y); } </script> </body></html>
效果图
阅读全文
0 0
- if, else if, else
- if else if else
- if (){}else if(){} else{}
- else if
- else if
- if-else
- if else
- if-else
- if else
- if else
- if else
- if { ...... } else { ...... }
- if else
- if...else
- if else
- if else
- if-else
- if--else
- python ztree 异步加载
- 认识Struts2的拦截器
- HDU4635 Strongly connected (tarjan)
- 数据库——purge和drop的区别
- [2017纪中10-25]凤凰院修真 LCIS最长公共上升子序列
- if...else
- [树状数组]BZOJ 2028——[SHOI2009]会场预约
- Android Activity的launchMode四种启动模式备忘
- mybatis 添加一条新数据并返回此数据的ID(主键)
- 32 x 8段液晶驱动HT1622 程序
- <队内胡策> 2017.10.24 求逆序对+表达式计算+贪心+Bfs+最短路、exgcd
- ubuntu14.04使用root账户登录
- Intellij IDEA 快捷键
- python的requests类库(一)requests库和urllib包对比:一个简单get请求