jquery_1.3_cheatsheet_v1

Page 1

jQuery 1.3 Cheat Sheet Core jQuery Function

Selectors Basic

Attribute Filters

FUNCTION

RETURNS

SELECTOR

RETURNS

$(expr, [context])

jQuery

*

Array<Element>

$(html, [owner])

jQuery

#id

Array<Element>

[attr=value]

2

Array<Element>

$(elems)

jQuery

name

Array<Element>

[attr!=value]

2

Array<Element>

$(func)

jQuery

.class

Array<Element>

[attr^=value]

2

Array<Element>

selector1, selectorN

Array<Element>

[attr$=value]

2

Array<Element>

[attr*=value]

2

jQuery Object Accessors PROPERTY

RETURNS

selector

1

context

1

Element

RETURNS

ancestor descendant

Array<Element>

length

Number

parent > child

Array<Element>

RETURNS

size()

Number

previous + next

Array<Element>

jQuery Array<Element>

get(index)

previous ~ siblings

Array<Element>

SELECTOR

RETURNS

:first

Array<Element>

Array<Element> 2

Array<Element>

2) The [@attr] style selectors were removed in jQuery 1.3

Basic Filters

Element

Array<Element>

[attr1][attr2][attrN]

SELECTOR

FUNCTION

get()

RETURNS

[attr]

Hierarchy

String

eq(index)

SELECTOR 2

Child Filters SELECTOR

RETURNS

:nth-child(index | even | odd | equation)

Array<Element>

:first-child

Array<Element>

:last-child

Array<Element>

:only-child

Array<Element>

index(element)

Number

:last

Array<Element>

each(func)

jQuery

:not(selector)

Array<Element>

SELECTOR

RETURNS

:even

Array<Element>

:hidden

Array<Element>

1) New in jQuery 1.3

Data

Forms

FUNCTION

RETURNS

:odd

Array<Element>

:input

Array<Element>

data(name)

Object

:eq(index)

Array<Element>

:text

Array<Element>

data(name, value)

jQuery

:gt(index)

Array<Element>

:password

Array<Element>

removeData(name)

jQuery

:lt(index)

Array<Element>

:checkbox

Array<Element>

queue(name)

Array<Function>

:header

Array<Element>

:radio

Array<Element>

queue(name, func)

jQuery

:animated

Array<Element>

:image

Array<Element>

queue(name, queue)

jQuery

:file

Array<Element>

dequeue(name)

jQuery

:button

Array<Element>

:submit

Array<Element>

:reset

Array<Element>

Content Filters

Plugins

SELECTOR

RETURNS

:contains(text)

Array<Element>

:empty

Array<Element>

FUNCTION

RETURNS

$.fn.extend(object)

jQuery

:has(selector)

Array<Element>

$.extend(object)

jQuery

:parent

Array<Element>

Interoperability FUNCTION

RETURNS

$.noConflict()

jQuery

$.noConflict(extreme)

jQuery

Visibility Filters SELECTOR

RETURNS

:hidden

Array<Element>

:visible

Array<Element>

Attributes Attr

Form Filters SELECTOR

RETURNS

:enabled

Array<Element>

:disabled

Array<Element>

:checked

Array<Element>

:selected

Array<Element>

Manipulation Insert Inside

Traversing Filtering

FUNCTION

RETURNS

FUNCTION

RETURNS

FUNCTION

RETURNS

attr(name)

Object

append(content)

jQuery

filter(expr)

jQuery

attr(props)

jQuery

appendTo(selector)

jQuery

filter(func)

jQuery

attr(key, value | func)

jQuery

prepend(content)

jQuery

is(expr)

Boolean

removeAttr(name)

jQuery

prependTo(selector)

jQuery

map(func)

jQuery

not(expr)

jQuery

slice(start, [end])

jQuery

Class

Insert Outside

FUNCTION

RETURNS

FUNCTION

RETURNS

hasClass(class)

Boolean

after(content)

jQuery

addClass(class)

jQuery

before(content)

jQuery

removeClass([class])

jQuery

insertAfter(content)

toggleClass(class)

jQuery

insertBefore(content)

toggleClass(class, switch)

jQuery

RETURNS

jQuery

add(expr)

jQuery

jQuery

children([expr])

jQuery

closest([expr])

jQuery

contents()

jQuery

find(expr)

jQuery

next([expr])

jQuery

nextAll([expr])

jQuery

prev([expr])

jQuery

jQuery

prevAll([expr])

jQuery

jQuery

offsetParent()

jQuery

parent([expr])

jQuery

Insert Around

HTML

FUNCTION

RETURNS

wrap(html | element)

jQuery

FUNCTION

RETURNS

html()

String

wrapAll(html | element)

jQuery

html(value)

jQuery

wrapInner(html | elem)

jQuery

Text FUNCTION

Replace RETURNS

text()

FUNCTION

RETURNS

replaceWith(content)

String

text(value)

Finding FUNCTION

replaceAll(selector)

jQuery

Value

Remove

FUNCTION

RETURNS

FUNCTION

RETURNS

parents([expr])

jQuery

val()

String, Array

empty()

jQuery

siblings([expr])

jQuery

val(value)

jQuery

remove([expr])

jQuery

Chaining FUNCTION

RETURNS

FUNCTION

RETURNS

andSelf()

jQuery

clone([events])

jQuery

end()

jQuery

Copy

Legend SYNTAX

function

DESCRIPTION

functions or properties

SYNTAX

argument

DESCRIPTION

arguments

SYNTAX

|

DESCRIPTION

one argument only

SYNTAX

[]

DESCRIPTION

optional argument


Turn static files into dynamic content formats.

Create a flipbook
Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.