2011-03-17 18 views
-1

由於某些原因,在此代碼片段中,我在過去的考試單選按鈕後獲得兩個後按鈕,另一個處於非常底部。另外,在我檢查單選按鈕並刷新頁面後,按鈕仍然會被檢查。我不知道什麼是錯的。我在html文檔中獲得兩個按鈕

<html> 
<head> 
<script type="text/javascript"> 
$(document).ready(function(){ 
$('#materialupdate li').click(function(){ 
switch($(this).attr('id')){ 
case "matup": 
$('#mf').show(); 
       break; 
       } 
      }); 
    }); 
    </script> 
</head> 
<body> 
<div> 
      <ul id="materialupdate" > 
       <li id="matup">Material </li> 

      </ul> 
      </div> 
<div id="mf"> 
       <form> 
        <div> 
        <label>Upload material:</label><input type="radio" name"material" id="up" value="" /> 
        <label>Request material:</label> <input type="radio" name"material" id="rm" value=""/> 
        </div> 


        <div> 
        <input type="radio" name="notes" class="matclass" value="" /><label>Notes</label><br/> 



        <input type="radio" name="handout" class="matclass" value="" /><label>Hand outs</label><br/> 



        <input type="radio" name="pastexams" class="matclass" value="" /><label>Past Exams</label><br/> 
        </div> 

        <table> 
         <tr id="subj"> 
         <td><label>Subject:</label></td> <td><input type="text" name="subject" id="sub" /></td> 
         </tr> 


        <tr id="top"> 
         <td><label>Topic:</label></td> <td><input type="text" name="topic" id="tpc" /></td> 

        </tr> 

        <tr id="prff"><div> 
         <td><label>Proff:</label> </td> <td><input type="text" name="proff" id="prof" /></td> 
        </div> 
        </tr> 
        <tr> <button id="post" class="post">post</button></tr> 

        </table> 
        <div><label>Description</label></div> 
        <div><textarea rows="3" cols="40"> </textarea></div> 

       </form> 
       <button id="post" class="post">post</button> 
      </div> 
+1

究竟是什麼問題?您看到兩個按鈕,因爲標記中有兩個按鈕。 – David 2011-03-17 01:28:09

回答

3

標記中有兩個後置按鈕。

   <tr> <button id="post" class="post">post</button></tr> 

       </table> 
       <div><label>Description</label></div> 
       <div><textarea rows="3" cols="40"> </textarea></div> 

      </form> 
      <button id="post" class="post">post</button> 
0

您的按鈕:

<button id="post" class="post">post</button> 

在貼標記重複兩次。

相關問題