在得分时更新我的​​桌子

时间:2013-05-16 22:29:31

标签: javascript html5

大家好,我已经创建了一张桌子,但是当我把分数放到时,它没有更新

<script type="text/javascript">
function updateTable(){    
  document.getElementById('err').innerHTML = '';    
  var firstdropbox = document.getElementById("first").value;    
  var seconddropbox = document.getElementById("second").value;    
  var box1 = Number(document.getElementById("txtbox1").value);    
  var box2 = Number(document.getElementById("txtbox2").value);    
  var a = Number(document.getElementById(firstdropbox).innerHTML);    
  var b = Number(document.getElementById(seconddropbox).innerHTML);   

  if(firstdropbox==seconddropbox){    
    alert("Must select two different teams..");
    return false;    
  }
  if(a>6){    
    alert("Can play only 7 matches");   
    return false;    
  }        
  if(firstdropbox != seconddropbox){            
    document.getElementById(firstdropbox).innerHTML = a + 1;   
    document.getElementById(seconddropbox).innerHTML = b + 1;
  }     
}    
</script>

0 个答案:

没有答案