我有這樣的代碼:jQuery的選擇DIV中的div內部形狀
$(document).ready(function() {
$form.find()
});
#second {
font-size: 20px;
color: green;
background: white;
text-align: center;
}
<form>
<div class="first" style="width: 301px; margin:5px 0 0 10px;">
<div id="second" style="font-size:18px; position: absolute; top: 8px; left: 5px; width: 300px; height: 42px;">Hello</div>
</div>
</form>
我要選擇div
與id="second"
,爲了改變background
到red
。有沒有解決方案使用find()
來做到這一點。
對我來說最重要的是選擇div
使用它的id
。 jsFiddle
不要隱藏你的代碼。 –