jQuery Selectors
jQuery Selectors ❮ Previous Next ❯ jQuery Selectors Use our jQuery Selector Tester to demonstrate the different selectors. Selector Example Selects * $("*") All elements # id $("#lastname") The element with id="lastname" . class $(".intro") All elements with class="intro" . class, . class $(".intro,...
www.w3schools.com
순서 또는 조건
|
||
:first
|
$("p:first")
|
The first <p> element
|
:last
|
$("p:last")
|
The last <p> element
|
:even
|
$("tr:even")
|
All even <tr> elements
|
:odd
|
$("tr:odd")
|
All odd <tr> elements
|
:focus
|
$(":focus")
|
The element that currently has focus
|
:empty
|
$(":empty")
|
All elements that are empty
|
:parent
|
$(":parent")
|
All elements that are a parent of another element
|
:hidden
|
$("p:hidden")
|
All hidden <p> elements
|
:visible
|
$("table:visible")
|
All visible tables
|
입력도구
|
||
:input
|
$(":input")
|
All input elements
|
:text
|
$(":text")
|
All input elements with type="text"
|
:password
|
$(":password")
|
All input elements with type="password"
|
:radio
|
$(":radio")
|
All input elements with type="radio"
|
:checkbox
|
$(":checkbox")
|
All input elements with type="checkbox"
|
:submit
|
$(":submit")
|
All input elements with type="submit"
|
:reset
|
$(":reset")
|
All input elements with type="reset"
|
:button
|
$(":button")
|
All input elements with type="button"
|
:image
|
$(":image")
|
All input elements with type="image"
|
:file
|
$(":file")
|
All input elements with type="file"
|
:enabled
|
$(":enabled")
|
All enabled input elements
|
:disabled
|
$(":disabled")
|
All disabled input elements
|
:selected
|
$(":selected")
|
All selected input elements
|
:checked
|
$(":checked")
|
All checked input elements
|
부모, 자식 관계
|
||
parent > child
|
$("div > p")
|
All <p> elements that are a direct child of a <div> element
|
parent descendant
|
$("div p")
|
All <p> elements that are descendants of a <div> element
|
element + next
|
$("div + p")
|
The <p> element that are next to each <div> elements
|
element ~ siblings
|
$("div ~ p")
|
All <p> elements that appear after the <div> element
|
'JAVASCRIPT > JQUERY' 카테고리의 다른 글
slide (0) | 2022.08.28 |
---|---|
fadeIn - fadeOut (0) | 2022.08.28 |
hide - show (0) | 2022.08.28 |
Event (0) | 2022.08.28 |
Selector (0) | 2022.08.28 |