我有一個表單提交按鈕,直到用戶選中一個複選框以表示它們是人類時纔可見(這不是我所知道的最佳做法,但我沒有足夠的控制把一個驗證碼進來)。使用jQuery顯示/隱藏父表單的元素
下面是HTML:
<div class="row">
<div class="large-5 columns large-centered center"
id="txtHuman" style="display:none">
<input class="button" name="submitbutton" type="submit" value="Vote now!" />
</div>
</div>
<div class="row">
<div class="large-3 columns large-centered verification">
<label for="isHumanSelected"><span></span></label>
<input type="checkbox" id="isHumanSelected" style="margin-left:-9999px"/>
</div>
</div>
這是jQuery的:
$('#isHumanSelected').click(function() {
$("#txtHuman").toggle(this.checked);
});
工程。但是我希望在表單提交按鈕可見時隱藏用於確定用戶是否爲人的複選框和標籤。
我該怎麼做?
道歉。忘了補充一點。現在編輯。 – themarcthomas