このコードの何が問題なのですか?私は二重の茶色のボーダーまたは固体青い枠を設定する条件に依存し、私が使用しているものの状態は関係ありません... if($(this).has("#tt"))
またはif(($(this).has("ssssssss")))
または何が、それは常に二重の茶色の境界線を入れ続け関数をパラメータとして使用するラップメソッド
のjQuery :
$(document).ready(function() {
$(".divvv").wrap(function() {
if ($(this).has("#tt")) {
return $("<div/>").css("border","double thick brown")
}
else {
return $("<div/>").css("border","solid blue")
}
})
})
HTML:
<div id="firstdiv" class="divvv">
<label class ="lab" id="tt" for="two">2</label>
<input type="checkbox" value="2" id="two" />
<label class ="lab" for="four">4</label>
<input type="checkbox" value="4" id="four" />
</div>
<div class="divvv" id="secdiv">
<button id="bu">Here</button><button id="bubu"> Button</button>
<label id="second">This is the <span style="color:aqua">second</span> label</label>
<label>This is the third label</label>
</div>