日期:2014-05-16  浏览次数:20312 次

急!!请帮帮忙解决这段代码在IE不兼容的问题
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
    $(function(){   
        $("button").click(function(){
            var a=$("#textfile").val();
            if($(this).val()!="Del" && $(this).val()!="BackSpace"){
                $("#textfile").val(a+$(this).val());
            }
            if($(this).val()=="BackSpace"){
                $("#textfile").val($("#textfile").val().substr(0,$("#textfile").val().length-1));
            }
            if($(this).val()=="Del"){
                $("#textfile").val('');
            }
        });
    })
</script>
<div class="note" align="center">
       <p>Please key in or scan your NRIC or T-pass:</p> 
       <form  action="ssk_2.html" >
      <input class="textbox" type="text"   id="textfile" size="60"   /><br />
      <input class="submit" type="submit" value="Submit">
       </form>
    </div>  
   <div class="keyboarddiv">
      <table class="keyboardtable" cellspacing="5px" cellpadding="0" width="761px">
    <tr>
    <td>
    <button id="1" class="keyboardbutton" value="1" ">
 1
 </button>
    </td>
      
    <td>
 <button  id="2"class="keyboardbutton">
 2
 </button>
    </td>
  <td>
    <button class="keyboardbutton">
 3
    </button>
    </td>
  <td>
    <button class="keyboardbutton">

------解决方案--------------------
 <button id="1" class="keyboardbutton" value="1" ">
------解决方案--------------------

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
$("button").click(function(){
var a=$("#textfile").val();
//aler