2016-03-14 71 views
0

HTML代碼:自動完成=關閉與自舉以及良好的工作?

<div class="col-md-2 col-md-offset-2 gallery-item"> 
       <div style="padding-top: 50%; float:right;"> 
        <label class="btn btn-info" for="notASign"> 
         <input type="radio" name="radio-button-group" id="radioid" autocomplete="off" >Radiobuttontext 
        </label> 
       </div> 
      </div> 

並沒有真正爲我工作在頁面刷新。單選按鈕保持選定狀態。

回答

2

單選按鈕通常用於從組中選擇單個項目。由於您的單選按鈕只是一個組中的一個,因此默認情況下會選中它。在這裏使用複選框可能更有意義:

<div class="checkbox"> 
    <label> 
    <input type="checkbox"> Check me out 
    </label> 
</div> 

默認情況下它不會被選中。此外,autocomplete=off旨在用於表單域,並禁止瀏覽器記住用戶之前輸入的內容。它不會影響單選按鈕或複選框:https://developer.mozilla.org/en-US/docs/Web/Security/Securing_your_site/Turning_off_form_autocompletion