在页上通过放置一个文本行,再放上一个按钮,在文本行中输入一个学生的高考分数,单击按钮,若输入的分数大于或者等于460,则显示“被录取”,否则显示“未被录取”。 

解决方案 »

  1.   

    <HTML>
    <HEAD>
    <TITLE>hello</TITLE> 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    </HEAD>
    <script>
    function check(){
    alert(document.getElementById('t').value > 460 ? '被录取!' : '未被录取!');
    }
    </script>
    <BODY> 
    <INPUT type="text" id="t"> 
    <INPUT type="button" value="click me" name="txtIPAddr" onclick="check()"> 
    </BODY>
    </HTML>
      

  2.   


    <script src="http://code.jquery.com/jquery-latest.js"></script>
    <script type="text/JavaScript">
    $(function(){
    $("#abv").click(function(){
    alert($("#aaa").val()>=460?"被录取":"未被录取");
    });
    })
    </script>
    <input type="text" id="aaa" />
    <input type="button" id="abv" value="点我掉钱"/>
      

  3.   

    <script type="text/javaScript">
        function finds(){
           var score=document.getElementById("score").value;
        if(score>=460){
              document.getElementById("show").innerHTML="被录取"; 
          }else{
              document.getElementById("show").innerHTML="未录取";
            }
        }
    </script><div id="show"></div>
    请输入分数:<input type="text" id="score"/>
    <input type="button" value="点击查询是否录取" onclick="finds()"/>