zoukankan      html  css  js  c++  java
  • js(if else)分数等级查询

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>文档标题</title>
    <link rel="stylesheet" href="imooc.css" type="text/css">
    <script src="https://www.imooc.com/static/lib/jquery/1.9.1/jquery.js"></script>
    <style type="text/css">
      span{color:red;}
      .a{color:red;}
      div{font-size:50px;
          color:#00ffff;
          font-family:"楷体"}
     </style>
    </head>
    <body>
        <h1>我的第一个HTML页面</h1>
        <p>我的第一个段落。</p >
     <form id="form1" runat ="server">
    <input type ="text" id="txbInfo" name="txbInfo"  style="80px;" />
    <input type ="button" id="btnGet" name="btnGet" value="查询分数等级" />
      </form>

       <div class="score"></div>

        <script type="text/javascript">document.write("a")</script>
        <script type="text/javascript" class="a">
          var h=("<div>hello</div>")
          document.write(h+"<span style='white-space:pre;'>"+"1      2          3    a" + "</span>")
      </script>
        <script type="text/javascript" >$(".a").css("color","red")</script>
      <script type="text/javascript">
        $("#btnGet").click(function(){
        var score=$("#txbInfo").val();
        // if(score>=80){document.write("优秀")}
        // else if(score>=70){document.write("中等")}
        // else if(score>=60){document.write("及格")}
        // else {document.write("不及格")};
       
        if(score>=80){
            $('.score').html("优秀")
        }
        else if(score>=70){
            $('.score').html("中等")
        }
        else if(score>=60){
            $('.score').html("及格")
        }
        else {
            $('.score').html("不及格")
        };
        })
       
      </script>
      
    </body>
    </html>

    红尘往事,一切随风!
  • 相关阅读:
    java中的位运算符
    Servlet中的初始化参数、上下文参数、以及@Resource资源注入
    Servlet中文件上传的几种方式
    marquee标签的使用
    SpringBoot热部署的两种方式
    eclipse中安装lombok插件
    关于Servlet中的转发和重定项
    Cormen — The Best Friend Of a Man CodeForces 732B
    牛客小白月赛9之签到题
    Codeforces アンバランス / Unbalanced
  • 原文地址:https://www.cnblogs.com/xwenwu/p/13630027.html
Copyright © 2011-2022 走看看