QUIZ
- How many siblings does the <p> element with the id=”txt” have in the following HTML?
- 다음 HTML에서 id=”txt” <p> element는 몇 개의 siblings를 가지는가?
<div>
<p></p>
<p id="txt"></p>
<p></p>
</div>
2
- Fill in the blanks to select the first child of the div element.
- div element의 첫 번째 child를 선택해라.
$("div").children().eq(0);
- Drag and drop from the options below to remove all children of the paragraph tag.
$("p").children().remove();
- What is the output of this code?
<div><p>1</p></div>
<div>2</div>
<script>
alert($("p").parent().siblings().eq(0).text());
</script>
2