<script language=javascript>
     function checkPressDown(){
        if(button1.value="sure"){
            alert("sure");
         }
     }
</script><body><input type=button id=button1 name=button1 value="sure"></body>

解决方案 »

  1.   

    var flag=1;
    <input type=button name=gua onclick="flag=0">
    <script>
    if (flag==0)
    alert("already pressed");
    </script>
      

  2.   

    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <input type=button name=test onclick='checkWho(this)' value='click me'>
    <script>
    function checkWho(it){
    o=document.all("test");
    for(i=0;i<o.length;i++){
    if(it.sourceIndex==o[i].sourceIndex){
    alert("i am is the "+i+1);
    }
    }
    }
    </script>
      

  3.   

    谢谢xiaoshi
    同时也谢谢木子园和瓜瓜