現在我使用jQuery來選擇某個元素。如何在沒有特殊子元素的jQuery中獲取元素
CODE:
<form class="form-horizontal" action="">
<div class="form-group">
<input type="text" name="key_word" class="form-control" value="">
<button type="submit" class="btn btn-primary btn-bg-red">
GO
</button>
</div>
</form>
而且我還有其他的形式:
<form class="form-horizontal" action="">
<div class="form-group">
<input type="text" name="key_word" class="form-control" value="">
<input type="text" name="test" class="form-control" value="">
<button type="submit" class="btn btn-primary btn-bg-red">
GO
</button>
</div>
</form>
如何做到的jQuery選擇第一種形式?即如何獲得沒有特殊孩子的元素?
'$('form.form - 水平')。當量(0)'? – roullie
是什麼讓孩子「特別」? –
我猜你的意思是「沒有孩子測試元素」? –