我的表單中有以下複選框,id想要知道如何檢查至少其中一個選中狀態,而不更改它們的名稱。檢查值是否存在
<label for="branding">Branding
<input type="checkbox" name="branding" id="branding" class="checkbox" /></label>
<label for="print">Print
<input type="checkbox" name="print" id="print" class="checkbox" /></label>
<label for="website">Website
<input type="checkbox" name="website" id="website" class="checkbox" /></label>
<label for="other">Other
<input type="checkbox" name="other" id="other" /></label>
您甚至可以使用布爾值而不是整數,或者只使用if(this || that || foo || bar){} 爲什麼不能重寫表單? – Emyr 2009-12-03 16:43:13
你知道這段代碼會在你的日誌文件中產生很多警告嗎? – Yacoby 2009-12-03 17:43:34