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>

    红尘往事,一切随风!
  • 相关阅读:
    linux mysql开启远程链接
    Nginx 下无法读取session 导致 thinkphp验证码错误
    Nginx 开启 path_info功能
    让chrome打开手机网页
    vue 组件和全局组件的注册、使用
    Vue 导入文件import、路径@和.的区别
    vue 打包路径不对设置方法
    id
    Ajax GET 和 POST 的区别
    前端笔试题汇总 2018/12/04 (2)
  • 原文地址:https://www.cnblogs.com/xwenwu/p/13630027.html
Copyright © 2011-2022 走看看