Category: jQuery

여섯 타일 가운데 첫 번째·세 번째·다섯 번째를 번갈아 강조한 일러스트

jQuery / Selector / :even - Select Even-Indexed Elements

Learn zero-based :even indexing and migrate to the recommended .even() method. A runnable two-list example compares combined selection, per-list selection and :nth-child(even), including expected results and reset controls.

표 모양의 여섯 칸 중 비어 있는 두 칸을 확대경으로 살펴보는 일러스트

jQuery / Selector / :empty - Select Elements with No Content

Understand how :empty treats whitespace, comments and child elements. A complete table example fills empty cells with N/A, resets them, and explains re-querying, .empty() and input-value checks.

원본 공지를 남겨 둔 채 두 영역의 맨 위에 같은 노란 공지를 복사한 모습

jQuery .prependTo(): Insert Content as the First Child

Use jQuery .prependTo() to move a notice to the first-child position or keep the original and insert copies at the start of several containers.

입력란과 기존 도움말 사이에 붉은 오류 문단이 추가되기 전과 후

jQuery .insertAfter(): Insert Content as the Next Sibling

Put an error message immediately after a form field with jQuery .insertAfter(), then compare sibling placement, insertion inside a target, and return values.

초안 영역에서 일정 제목 바로 앞으로 이동한 노란 공지

jQuery .insertBefore(): Insert Content as the Previous Sibling

Move an existing notice immediately before a target with jQuery .insertBefore() and verify sibling placement and that its button still works.

길게 펼쳐진 파란 패널과 같은 높이에서 짧게 접힌 파란 패널

jQuery .slideToggle(): Toggle a Collapsible Panel

Toggle a hidden or visible panel with jQuery .slideToggle(), handle rapid clicks and reset, and wait for several panels to finish.

길게 펼쳐진 파란 패널과 같은 높이에서 짧게 접힌 파란 패널

jQuery .slideDown(): Expand and Show Hidden Content

Reveal a hidden panel with jQuery .slideDown(), wait for the effects queue, and diagnose an ancestor or CSS rule that keeps the panel hidden.

길게 펼쳐진 파란 패널과 같은 높이에서 짧게 접힌 파란 패널

jQuery .slideUp(): Collapse and Hide Content

Collapse an element with jQuery .slideUp(), distinguish per-element and queue completion, and test a panel with keyboard focus and rapid inputs.

jquery reference val 03

jQuery .val(): Read and Set Form Field Values

Read and set current field values and multiple selections, and handle change events separately from value assignment.

jquery reference each 01

jQuery .each(): Iterate over Elements and Stop a Loop

Use callback indices and element references, stop a loop correctly, and avoid confusing element iteration with asynchronous sequencing.