jquery-cheat 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ == 0.0.1 2007-05-30
2
+
3
+ * 1 major enhancement:
4
+ * Initial release
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2007 FIXME full name
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,18 @@
1
+ History.txt
2
+ License.txt
3
+ Manifest.txt
4
+ README.txt
5
+ Rakefile
6
+ bin/jcheat
7
+ lib/index.xml
8
+ lib/jquery-cheat/version.rb
9
+ lib/jquery.dumped
10
+ scripts/txt2html
11
+ setup.rb
12
+ test/test_helper.rb
13
+ test/test_jquery-cheat.rb
14
+ website/index.html
15
+ website/index.txt
16
+ website/javascripts/rounded_corners_lite.inc.js
17
+ website/stylesheets/screen.css
18
+ website/template.rhtml
@@ -0,0 +1,3 @@
1
+ README for jquery-cheat
2
+ =======================
3
+
@@ -0,0 +1,123 @@
1
+ require 'rubygems'
2
+ require 'rake'
3
+ require 'rake/clean'
4
+ require 'rake/testtask'
5
+ require 'rake/packagetask'
6
+ require 'rake/gempackagetask'
7
+ require 'rake/rdoctask'
8
+ require 'rake/contrib/rubyforgepublisher'
9
+ require 'fileutils'
10
+ require 'hoe'
11
+
12
+ include FileUtils
13
+ require File.join(File.dirname(__FILE__), 'lib', 'jquery-cheat', 'version')
14
+
15
+ AUTHOR = 'Yehuda Katz' # can also be an array of Authors
16
+ EMAIL = "wycats@gmailcom"
17
+ DESCRIPTION = "jQuery command-line API reference"
18
+ GEM_NAME = 'jquery-cheat' # what ppl will type to install your gem
19
+
20
+ @config_file = "~/.rubyforge/user-config.yml"
21
+ @config = nil
22
+ def rubyforge_username
23
+ unless @config
24
+ begin
25
+ @config = YAML.load(File.read(File.expand_path(@config_file)))
26
+ rescue
27
+ puts <<-EOS
28
+ ERROR: No rubyforge config file found: #{@config_file}"
29
+ Run 'rubyforge setup' to prepare your env for access to Rubyforge
30
+ - See http://newgem.rubyforge.org/rubyforge.html for more details
31
+ EOS
32
+ exit
33
+ end
34
+ end
35
+ @rubyforge_username ||= @config["username"]
36
+ end
37
+
38
+ RUBYFORGE_PROJECT = 'jquery-cheat' # The unix name for your project
39
+ HOMEPATH = "http://#{RUBYFORGE_PROJECT}.rubyforge.org"
40
+ DOWNLOAD_PATH = "http://rubyforge.org/projects/#{RUBYFORGE_PROJECT}"
41
+
42
+ NAME = "jquery-cheat"
43
+ REV = nil
44
+ # UNCOMMENT IF REQUIRED:
45
+ # REV = `svn info`.each {|line| if line =~ /^Revision:/ then k,v = line.split(': '); break v.chomp; else next; end} rescue nil
46
+ VERS = JQueryCheat::VERSION::STRING + (REV ? ".#{REV}" : "")
47
+ CLEAN.include ['**/.*.sw?', '*.gem', '.config', '**/.DS_Store']
48
+ RDOC_OPTS = ['--quiet', '--title', 'jquery-cheat documentation',
49
+ "--opname", "index.html",
50
+ "--line-numbers",
51
+ "--main", "README",
52
+ "--inline-source"]
53
+
54
+ class Hoe
55
+ def extra_deps
56
+ @extra_deps.reject { |x| Array(x).first == 'hoe' }
57
+ end
58
+ end
59
+
60
+ # Generate all the Rake tasks
61
+ # Run 'rake -T' to see list of generated tasks (from gem root directory)
62
+ hoe = Hoe.new(GEM_NAME, VERS) do |p|
63
+ p.author = AUTHOR
64
+ p.description = DESCRIPTION
65
+ p.email = EMAIL
66
+ p.summary = DESCRIPTION
67
+ p.url = HOMEPATH
68
+ p.rubyforge_name = RUBYFORGE_PROJECT if RUBYFORGE_PROJECT
69
+ p.test_globs = ["test/**/test_*.rb"]
70
+ p.clean_globs = CLEAN #An array of file patterns to delete on clean.
71
+
72
+ # == Optional
73
+ p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
74
+ p.extra_deps = [ ['hpricot', '>= 0.5'] ] # An array of rubygem dependencies [name, version], e.g. [ ['active_support', '>= 1.3.1'] ]
75
+ #p.spec_extras = {} # A hash of extra values to set in the gemspec.
76
+ end
77
+
78
+ CHANGES = hoe.paragraphs_of('History.txt', 0..1).join("\n\n")
79
+ PATH = (RUBYFORGE_PROJECT == GEM_NAME) ? RUBYFORGE_PROJECT : "#{RUBYFORGE_PROJECT}/#{GEM_NAME}"
80
+ hoe.remote_rdoc_dir = File.join(PATH.gsub(/^#{RUBYFORGE_PROJECT}\/?/,''), 'rdoc')
81
+
82
+ desc 'Generate website files'
83
+ task :website_generate do
84
+ Dir['website/**/*.txt'].each do |txt|
85
+ sh %{ ruby scripts/txt2html #{txt} > #{txt.gsub(/txt$/,'html')} }
86
+ end
87
+ end
88
+
89
+ desc 'Upload website files to rubyforge'
90
+ task :website_upload do
91
+ host = "#{rubyforge_username}@rubyforge.org"
92
+ remote_dir = "/var/www/gforge-projects/#{PATH}/"
93
+ local_dir = 'website'
94
+ sh %{rsync -av #{local_dir}/ #{host}:#{remote_dir}}
95
+ end
96
+
97
+ desc 'Generate and upload website files'
98
+ task :website => [:website_generate, :website_upload]
99
+
100
+ desc 'Release the website and new gem version'
101
+ task :deploy => [:check_version, :website, :release] do
102
+ puts "Remember to create SVN tag:"
103
+ puts "svn copy svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/trunk " +
104
+ "svn+ssh://#{rubyforge_username}@rubyforge.org/var/svn/#{PATH}/tags/REL-#{VERS} "
105
+ puts "Suggested comment:"
106
+ puts "Tagging release #{CHANGES}"
107
+ end
108
+
109
+ desc 'Runs tasks website_generate and install_gem as a local deployment of the gem'
110
+ task :local_deploy => [:website_generate, :install_gem]
111
+
112
+ task :check_version do
113
+ unless ENV['VERSION']
114
+ puts 'Must pass a VERSION=x.y.z release version'
115
+ exit
116
+ end
117
+ unless ENV['VERSION'] == VERS
118
+ puts "Please update your version.rb to match the release version, currently #{VERS}"
119
+ exit
120
+ end
121
+ end
122
+
123
+
@@ -0,0 +1,151 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'hpricot'
5
+ gem 'jquery-cheat'
6
+
7
+ PATH = File.join(File.dirname(__FILE__), '..', 'lib','jquery.dumped')
8
+
9
+ class JQueryMethod
10
+
11
+ attr_accessor :short, :long, :cat, :params, :options, :examples, :name, :attributes, :param_order, :type
12
+
13
+ def initialize elem
14
+ @name = elem.attributes["name"]
15
+ @short = elem.attributes["short"]
16
+ @long = elem.search("> desc").inner_text
17
+ @cat = elem.attributes["cat"]
18
+ @params = elem.search("params").inject({}) {|s,p| s.merge(p.attributes["name"] => [p.search("desc").inner_text, p.attributes["type"]]) }
19
+ @param_order = elem.search("params").map {|p| p.attributes["name"]}
20
+ @options = elem.search("options").inject({}) {|s,p| s.merge(p.attributes["name"] => [p.search("desc").inner_text, p.attributes["type"]]) }
21
+ @type = elem.attributes["type"]
22
+ @examples = elem.search("examples").map do |example|
23
+ {:desc => example.search("desc").inner_text,
24
+ :before => example.search("before").inner_text,
25
+ :code => example.search("code").inner_text,
26
+ :result => example.search("result").inner_text
27
+ }
28
+
29
+ end
30
+ @attributes = elem.attributes
31
+ end
32
+
33
+ def signature
34
+ "#{name}#{"(#{ param_order.join(", ") })" if !attributes["property"] } in #{cat}"
35
+ end
36
+
37
+ end
38
+
39
+ class JQueryMethods < Array
40
+
41
+ File.open(PATH) {|f| @@parsed = Marshal.load(f) }
42
+
43
+ def initialize els
44
+ push(*els.to_jquery_methods)
45
+ end
46
+
47
+ def self.with_name_and_params name, *params
48
+ new(@@parsed.search("method[@name='#{name}']").reject{|m| params.any? {|p| m.search("params[@name=#{p}]").length == 0 } })
49
+ end
50
+
51
+ def self.in_module mod, recursive
52
+ new(@@parsed.search("[@cat#{ '*' if recursive.to_s =~ /^\-?r/i }='#{mod}']")).named_list
53
+ end
54
+
55
+ def self.description_matches list
56
+ new(@@parsed.search("method").select {|m| list.all? {|t| m.search("> desc").inner_text =~ /#{t}/i} }).named_list
57
+ end
58
+
59
+ def self.named name, precise = false
60
+ new(@@parsed.search("method[@name#{ precise ? "=" : "*=" }'#{name}']")).named_list
61
+ end
62
+
63
+ def named_list
64
+ list = inject([]) {|s,m| s.push(m.signature) }
65
+ list.empty? ? ["No items found"] : list
66
+ end
67
+
68
+ end
69
+
70
+ class Array
71
+
72
+ def to_jquery_methods
73
+ map {|m| JQueryMethod.new(m)}
74
+ end
75
+
76
+ end
77
+
78
+ class String
79
+
80
+ def word_wrap cols, padding = 0
81
+ gsub(/\n\n/, "\r").gsub(/\n/, ' ').gsub(/\r/, "\n\n#{' ' * 14}").gsub(/(.{1,#{cols}}|\S{#{cols + 1},})(?: +|$\n?)/, "\\1\n#{ ' ' * padding}")
82
+ end
83
+ end
84
+
85
+ line = "-" * 80
86
+
87
+ if ARGV[0] == "describe" || ARGV[0] == "desc"
88
+ methods = JQueryMethods.with_name_and_params(ARGV[1], *ARGV[2..-1])
89
+
90
+ for method in methods
91
+ puts line
92
+ puts "Name: #{method.name}#{"(#{ method.params.map{|x| x[1][1] + " " + x[0]}.join(", ") })" if !method.attributes["property"] }\n" +
93
+ ("Options: #{"#{ method.options.map{|x| x[1][1] + " " + x[0]}.join("\n" + (" " * 14)) }" }\n\n" if !method.options.empty?).to_s +
94
+ "Description: #{method.short.word_wrap(62, 14)}\n" +
95
+ "Details: #{method.long.word_wrap(62, 14)}\n" +
96
+ "Returns: #{method.type}\n"
97
+ puts "#{line}\n|#{" " * 35 }EXAMPLES#{" " * 35}|\n#{line}\n"
98
+ for example in method.examples
99
+ puts "---------------\n| Description |\n---------------\n#{example[:desc].word_wrap(80)}\n" if example[:desc] != ""
100
+ puts "----------\n| Before |\n----------\n#{example[:before]}\n\n" if example[:before] != ""
101
+ puts "--------\n| Code |\n--------\n#{example[:code]}\n\n" if example[:code] != ""
102
+ puts "----------\n| Result |\n----------\n#{example[:result]}\n\n" if example[:result] != ""
103
+ puts "\n"
104
+ end
105
+ end
106
+ elsif ARGV[0] == "list"
107
+ puts JQueryMethods.in_module(ARGV[1], ARGV[2]).join("\n")
108
+ elsif ARGV[0] =~ /^(apopros|ap|like)$/
109
+ puts JQueryMethods.description_matches(ARGV[1..-1]).join("\n")
110
+ elsif ARGV[0] == "named"
111
+ puts JQueryMethods.named(ARGV[1], true).join("\n")
112
+ elsif ARGV[0] =~ /^(namelike|nl)$/
113
+ puts JQueryMethods.named(ARGV[1], false).join("\n")
114
+ else
115
+ puts %q{
116
+ jcheat takes any of the following parameters:
117
+
118
+ (describe|desc) METHOD_NAME [PARAM1, ...]
119
+ > the full description of each method matching METHOD_NAME.
120
+ > If you also pass optional PARAMs, the list of matching
121
+ > methods will be filtered to include only methods with those
122
+ > parameters.
123
+ >
124
+ > Example: "jcheat desc $ html" will return the description
125
+ > of the $ method with an "html" parameter.
126
+
127
+ * list MODULE_NAME [-r]
128
+ > A list of all methods directly under a specific module. Passing
129
+ > an optional "-r" will return a list of all methods at any level
130
+ > under the module.
131
+ >
132
+ > Example: "jcheat list DOM/Traversing"
133
+
134
+ * (apopros|ap|like) STRING
135
+ > A list of all methods whose description contains all of the
136
+ > words in STRING.
137
+ >
138
+ > Example: "jcheat like clear fields"
139
+
140
+ * named STRING
141
+ > A list of all methods named exactly STRING.
142
+ >
143
+ > Example: "jcheat named $"
144
+
145
+ * (namelike|nl) STRING
146
+ > A list of all methods whose names contain STRING.
147
+ >
148
+ > Example: "jcheat nl clear"
149
+
150
+ }
151
+ end
@@ -0,0 +1,5071 @@
1
+ <?xml version='1.0' encoding='ISO-8859-1'?>
2
+ <?xml-stylesheet type='text/xsl' href='style/docs.xsl'?>
3
+ <docs version='1.1.3a'>
4
+ <method cat='Core' type='jQuery' short='This function accepts a string containing a CSS or
5
+ basic XPath selector which is then used to match a set of elements.' name='$'>
6
+ <desc>This function accepts a string containing a CSS or
7
+ basic XPath selector which is then used to match a set of elements.
8
+
9
+ The core functionality of jQuery centers around this function.
10
+ Everything in jQuery is based upon this, or uses this in some way.
11
+ The most basic use of this function is to pass in an expression
12
+ (usually consisting of CSS or XPath), which then finds all matching
13
+ elements.
14
+
15
+ By default, if no context is specified, $() looks for DOM elements within the context of the
16
+ current HTML document. If you do specify a context, such as a DOM
17
+ element or jQuery object, the expression will be matched against
18
+ the contents of that context.
19
+
20
+ See [[DOM/Traversing/Selectors]] for the allowed CSS/XPath syntax for expressions.</desc>
21
+ <see>$(Element)</see>
22
+ <see>$(Element&lt;Array&gt;)</see>
23
+ <params type='String' name='expr'>
24
+ <desc>An expression to search with</desc>
25
+ </params>
26
+ <params type='Element|jQuery' name='context'>
27
+ <desc>(optional) A DOM Element, Document or jQuery to use as context</desc>
28
+ </params>
29
+ <examples>
30
+ <desc>Finds all p elements that are children of a div element.</desc>
31
+ <before>&lt;p&gt;one&lt;/p&gt; &lt;div&gt;&lt;p&gt;two&lt;/p&gt;&lt;/div&gt; &lt;p&gt;three&lt;/p&gt;</before>
32
+ <code>$("div &gt; p")</code>
33
+ <result>[ &lt;p&gt;two&lt;/p&gt; ]</result>
34
+ </examples>
35
+ <examples>
36
+ <desc>Searches for all inputs of type radio within the first form in the document</desc>
37
+ <code>$("input:radio", document.forms[0])</code>
38
+ </examples>
39
+ <examples>
40
+ <desc>This finds all div elements within the specified XML document.</desc>
41
+ <code>$("div", xml.responseXML)</code>
42
+ </examples>
43
+ </method>
44
+ <method cat='Core' type='jQuery' see='appendTo(String)' short='Create DOM elements on-the-fly from the provided String of raw HTML.' name='$'>
45
+ <desc>Create DOM elements on-the-fly from the provided String of raw HTML.</desc>
46
+ <params type='String' name='html'>
47
+ <desc>A string of HTML to create on the fly.</desc>
48
+ </params>
49
+ <examples>
50
+ <desc>Creates a div element (and all of its contents) dynamically,
51
+ and appends it to the body element. Internally, an
52
+ element is created and its innerHTML property set to the given markup.
53
+ It is therefore both quite flexible and limited.</desc>
54
+ <code>$("&lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt;").appendTo("body")</code>
55
+ </examples>
56
+ </method>
57
+ <method cat='Core' type='jQuery' short='Wrap jQuery functionality around a single or multiple DOM Element(s).' name='$'>
58
+ <desc>Wrap jQuery functionality around a single or multiple DOM Element(s).
59
+
60
+ This function also accepts XML Documents and Window objects
61
+ as valid arguments (even though they are not DOM Elements).</desc>
62
+ <params type='Element|Array&lt;Element&gt;' name='elems'>
63
+ <desc>DOM element(s) to be encapsulated by a jQuery object.</desc>
64
+ </params>
65
+ <examples>
66
+ <desc>Sets the background color of the page to black.</desc>
67
+ <code>$(document.body).css( "background", "black" );</code>
68
+ </examples>
69
+ <examples>
70
+ <desc>Hides all the input elements within a form</desc>
71
+ <code>$( myForm.elements ).hide()</code>
72
+ </examples>
73
+ </method>
74
+ <method cat='Core' type='jQuery' see='ready(Function)' short='A shorthand for $(document).' name='$'>
75
+ <desc>A shorthand for $(document).ready(), allowing you to bind a function
76
+ to be executed when the DOM document has finished loading. This function
77
+ behaves just like $(document).ready(), in that it should be used to wrap
78
+ other $() operations on your page that depend on the DOM being ready to be
79
+ operated on. While this function is, technically, chainable - there really
80
+ isn't much use for chaining against it.
81
+
82
+ You can have as many $(document).ready events on your page as you like.
83
+
84
+ See ready(Function) for details about the ready event.</desc>
85
+ <params type='Function' name='fn'>
86
+ <desc>The function to execute when the DOM is ready.</desc>
87
+ </params>
88
+ <examples>
89
+ <desc>Executes the function when the DOM is ready to be used.</desc>
90
+ <code>$(function(){
91
+ // Document is ready
92
+ });</code>
93
+ </examples>
94
+ <examples>
95
+ <desc>Uses both the shortcut for $(document).ready() and the argument
96
+ to write failsafe jQuery code using the $ alias, without relying on the
97
+ global alias.</desc>
98
+ <code>jQuery(function($) {
99
+ // Your code using failsafe $ alias here...
100
+ });</code>
101
+ </examples>
102
+ </method>
103
+ <method cat='Core' short='Initialize a new jQuery object' name='init' private='1'>
104
+ <desc>Initialize a new jQuery object</desc>
105
+ <params type='String|Function|Element|Array&lt;Element&gt;|jQuery' name='a'>
106
+ <desc>selector</desc>
107
+ </params>
108
+ <params type='jQuery|Element|Array&lt;Element&gt;' name='c'>
109
+ <desc>context</desc>
110
+ </params>
111
+ </method>
112
+ <method property='1' cat='Core' type='String' short='The current version of jQuery.' name='jquery' private='1'>
113
+ <desc>The current version of jQuery.</desc>
114
+ </method>
115
+ <method property='1' cat='Core' type='Number' short='The number of elements currently matched.' name='length'>
116
+ <desc>The number of elements currently matched. The size function will return the same value.</desc>
117
+ <examples>
118
+ <code>$("img").length;</code>
119
+ <result>2</result>
120
+ <before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before>
121
+ </examples>
122
+ </method>
123
+ <method cat='Core' type='Number' short='Get the number of elements currently matched.' name='size'>
124
+ <desc>Get the number of elements currently matched. This returns the same
125
+ number as the 'length' property of the jQuery object.</desc>
126
+ <examples>
127
+ <code>$("img").size();</code>
128
+ <result>2</result>
129
+ <before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before>
130
+ </examples>
131
+ </method>
132
+ <method cat='Core' type='Array&lt;Element&gt;' short='Access all matched DOM elements.' name='get'>
133
+ <desc>Access all matched DOM elements. This serves as a backwards-compatible
134
+ way of accessing all matched elements (other than the jQuery object
135
+ itself, which is, in fact, an array of elements).
136
+
137
+ It is useful if you need to operate on the DOM elements themselves instead of using built-in jQuery functions.</desc>
138
+ <examples>
139
+ <desc>Selects all images in the document and returns the DOM Elements as an Array</desc>
140
+ <before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before>
141
+ <code>$("img").get();</code>
142
+ <result>[ &lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt; ]</result>
143
+ </examples>
144
+ </method>
145
+ <method cat='Core' type='Element' short='Access a single matched DOM element at a specified index in the matched set.' name='get'>
146
+ <desc>Access a single matched DOM element at a specified index in the matched set.
147
+ This allows you to extract the actual DOM element and operate on it
148
+ directly without necessarily using jQuery functionality on it.</desc>
149
+ <params type='Number' name='num'>
150
+ <desc>Access the element in the Nth position.</desc>
151
+ </params>
152
+ <examples>
153
+ <desc>Selects all images in the document and returns the first one</desc>
154
+ <before>&lt;img src="test1.jpg"/&gt; &lt;img src="test2.jpg"/&gt;</before>
155
+ <code>$("img").get(0);</code>
156
+ <result>&lt;img src="test1.jpg"/&gt;</result>
157
+ </examples>
158
+ </method>
159
+ <method cat='Core' type='jQuery' short='Set the jQuery object to an array of elements, while maintaining
160
+ the stack.' name='pushStack' private='1'>
161
+ <desc>Set the jQuery object to an array of elements, while maintaining
162
+ the stack.</desc>
163
+ <params type='Elements' name='elems'>
164
+ <desc>An array of elements</desc>
165
+ </params>
166
+ <examples>
167
+ <code>$("img").pushStack([ document.body ]);</code>
168
+ <result>$("img").pushStack() == [ document.body ]</result>
169
+ </examples>
170
+ </method>
171
+ <method cat='Core' type='jQuery' short='Set the jQuery object to an array of elements.' name='setArray' private='1'>
172
+ <desc>Set the jQuery object to an array of elements. This operation is
173
+ completely destructive - be sure to use .pushStack() if you wish to maintain
174
+ the jQuery stack.</desc>
175
+ <params type='Elements' name='elems'>
176
+ <desc>An array of elements</desc>
177
+ </params>
178
+ <examples>
179
+ <code>$("img").setArray([ document.body ]);</code>
180
+ <result>$("img").setArray() == [ document.body ]</result>
181
+ </examples>
182
+ </method>
183
+ <method cat='Core' type='jQuery' short='Execute a function within the context of every matched element.' name='each'>
184
+ <desc>Execute a function within the context of every matched element.
185
+ This means that every time the passed-in function is executed
186
+ (which is once for every element matched) the 'this' keyword
187
+ points to the specific DOM element.
188
+
189
+ Additionally, the function, when executed, is passed a single
190
+ argument representing the position of the element in the matched
191
+ set (integer, zero-index).</desc>
192
+ <params type='Function' name='fn'>
193
+ <desc>A function to execute</desc>
194
+ </params>
195
+ <examples>
196
+ <desc>Iterates over two images and sets their src property</desc>
197
+ <before>&lt;img/&gt;&lt;img/&gt;</before>
198
+ <code>$("img").each(function(i){
199
+ this.src = "test" + i + ".jpg";
200
+ });</code>
201
+ <result>&lt;img src="test0.jpg"/&gt;&lt;img src="test1.jpg"/&gt;</result>
202
+ </examples>
203
+ </method>
204
+ <method cat='Core' type='Number' short='Searches every matched element for the object and returns
205
+ the index of the element, if found, starting with zero.' name='index'>
206
+ <desc>Searches every matched element for the object and returns
207
+ the index of the element, if found, starting with zero.
208
+ Returns -1 if the object wasn't found.</desc>
209
+ <params type='Element' name='subject'>
210
+ <desc>Object to search for</desc>
211
+ </params>
212
+ <examples>
213
+ <desc>Returns the index for the element with ID foobar</desc>
214
+ <before>&lt;div id="foobar"&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;&lt;/div&gt;</before>
215
+ <code>$("*").index( $('#foobar')[0] )</code>
216
+ <result>0</result>
217
+ </examples>
218
+ <examples>
219
+ <desc>Returns the index for the element with ID foo within another element</desc>
220
+ <before>&lt;div id="foobar"&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;&lt;/div&gt;</before>
221
+ <code>$("*").index( $('#foo')[0] )</code>
222
+ <result>2</result>
223
+ </examples>
224
+ <examples>
225
+ <desc>Returns -1, as there is no element with ID bar</desc>
226
+ <before>&lt;div id="foobar"&gt;&lt;b&gt;&lt;/b&gt;&lt;span id="foo"&gt;&lt;/span&gt;&lt;/div&gt;</before>
227
+ <code>$("*").index( $('#bar')[0] )</code>
228
+ <result>-1</result>
229
+ </examples>
230
+ </method>
231
+ <method cat='DOM/Attributes' type='Object' short='Access a property on the first matched element.' name='attr'>
232
+ <desc>Access a property on the first matched element.
233
+ This method makes it easy to retrieve a property value
234
+ from the first matched element.
235
+
236
+ If the element does not have an attribute with such a
237
+ name, undefined is returned.</desc>
238
+ <params type='String' name='name'>
239
+ <desc>The name of the property to access.</desc>
240
+ </params>
241
+ <examples>
242
+ <desc>Returns the src attribute from the first image in the document.</desc>
243
+ <before>&lt;img src="test.jpg"/&gt;</before>
244
+ <code>$("img").attr("src");</code>
245
+ <result>test.jpg</result>
246
+ </examples>
247
+ </method>
248
+ <method cat='DOM/Attributes' type='jQuery' short='Set a key/value object as properties to all matched elements.' name='attr'>
249
+ <desc>Set a key/value object as properties to all matched elements.
250
+
251
+ This serves as the best way to set a large number of properties
252
+ on all matched elements.</desc>
253
+ <params type='Map' name='properties'>
254
+ <desc>Key/value pairs to set as object properties.</desc>
255
+ </params>
256
+ <examples>
257
+ <desc>Sets src and alt attributes to all images.</desc>
258
+ <before>&lt;img/&gt;</before>
259
+ <code>$("img").attr({ src: "test.jpg", alt: "Test Image" });</code>
260
+ <result>&lt;img src="test.jpg" alt="Test Image"/&gt;</result>
261
+ </examples>
262
+ </method>
263
+ <method cat='DOM/Attributes' type='jQuery' short='Set a single property to a value, on all matched elements.' name='attr'>
264
+ <desc>Set a single property to a value, on all matched elements.
265
+
266
+ Note that you can't set the name property of input elements in IE.
267
+ Use $(html) or .append(html) or .html(html) to create elements
268
+ on the fly including the name property.</desc>
269
+ <params type='String' name='key'>
270
+ <desc>The name of the property to set.</desc>
271
+ </params>
272
+ <params type='Object' name='value'>
273
+ <desc>The value to set the property to.</desc>
274
+ </params>
275
+ <examples>
276
+ <desc>Sets src attribute to all images.</desc>
277
+ <before>&lt;img/&gt;</before>
278
+ <code>$("img").attr("src","test.jpg");</code>
279
+ <result>&lt;img src="test.jpg"/&gt;</result>
280
+ </examples>
281
+ </method>
282
+ <method cat='DOM/Attributes' type='jQuery' short='Set a single property to a computed value, on all matched elements.' name='attr'>
283
+ <desc>Set a single property to a computed value, on all matched elements.
284
+
285
+ Instead of supplying a string value as described
286
+ [[DOM/Attributes#attr.28_key.2C_value_.29|above]],
287
+ a function is provided that computes the value.</desc>
288
+ <params type='String' name='key'>
289
+ <desc>The name of the property to set.</desc>
290
+ </params>
291
+ <params type='Function' name='value'>
292
+ <desc>A function returning the value to set. Scope: Current element, argument: Index of current element</desc>
293
+ </params>
294
+ <examples>
295
+ <desc>Sets title attribute from src attribute.</desc>
296
+ <before>&lt;img src="test.jpg" /&gt;</before>
297
+ <code>$("img").attr("title", function() { return this.src });</code>
298
+ <result>&lt;img src="test.jpg" title="test.jpg" /&gt;</result>
299
+ </examples>
300
+ <examples>
301
+ <desc>Enumerate title attribute.</desc>
302
+ <before>&lt;img title="pic" /&gt;&lt;img title="pic" /&gt;&lt;img title="pic" /&gt;</before>
303
+ <code>$("img").attr("title", function(index) { return this.title + (i + 1); });</code>
304
+ <result>&lt;img title="pic1" /&gt;&lt;img title="pic2" /&gt;&lt;img title="pic3" /&gt;</result>
305
+ </examples>
306
+ </method>
307
+ <method cat='CSS' type='String' short='Access a style property on the first matched element.' name='css'>
308
+ <desc>Access a style property on the first matched element.
309
+ This method makes it easy to retrieve a style property value
310
+ from the first matched element.</desc>
311
+ <params type='String' name='name'>
312
+ <desc>The name of the property to access.</desc>
313
+ </params>
314
+ <examples>
315
+ <desc>Retrieves the color style of the first paragraph</desc>
316
+ <before>&lt;p style="color:red;"&gt;Test Paragraph.&lt;/p&gt;</before>
317
+ <code>$("p").css("color");</code>
318
+ <result>"red"</result>
319
+ </examples>
320
+ <examples>
321
+ <desc>Retrieves the font-weight style of the first paragraph.</desc>
322
+ <before>&lt;p style="font-weight: bold;"&gt;Test Paragraph.&lt;/p&gt;</before>
323
+ <code>$("p").css("font-weight");</code>
324
+ <result>"bold"</result>
325
+ </examples>
326
+ </method>
327
+ <method cat='CSS' type='jQuery' short='Set a key/value object as style properties to all matched elements.' name='css'>
328
+ <desc>Set a key/value object as style properties to all matched elements.
329
+
330
+ This serves as the best way to set a large number of style properties
331
+ on all matched elements.</desc>
332
+ <params type='Map' name='properties'>
333
+ <desc>Key/value pairs to set as style properties.</desc>
334
+ </params>
335
+ <examples>
336
+ <desc>Sets color and background styles to all p elements.</desc>
337
+ <before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
338
+ <code>$("p").css({ color: "red", background: "blue" });</code>
339
+ <result>&lt;p style="color:red; background:blue;"&gt;Test Paragraph.&lt;/p&gt;</result>
340
+ </examples>
341
+ </method>
342
+ <method cat='CSS' type='jQuery' short='Set a single style property to a value, on all matched elements.' name='css'>
343
+ <desc>Set a single style property to a value, on all matched elements.
344
+ If a number is provided, it is automatically converted into a pixel value.</desc>
345
+ <params type='String' name='key'>
346
+ <desc>The name of the property to set.</desc>
347
+ </params>
348
+ <params type='String|Number' name='value'>
349
+ <desc>The value to set the property to.</desc>
350
+ </params>
351
+ <examples>
352
+ <desc>Changes the color of all paragraphs to red</desc>
353
+ <before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
354
+ <code>$("p").css("color","red");</code>
355
+ <result>&lt;p style="color:red;"&gt;Test Paragraph.&lt;/p&gt;</result>
356
+ </examples>
357
+ <examples>
358
+ <desc>Changes the left of all paragraphs to "30px"</desc>
359
+ <before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
360
+ <code>$("p").css("left",30);</code>
361
+ <result>&lt;p style="left:30px;"&gt;Test Paragraph.&lt;/p&gt;</result>
362
+ </examples>
363
+ </method>
364
+ <method cat='DOM/Attributes' type='String' short='Get the text contents of all matched elements.' name='text'>
365
+ <desc>Get the text contents of all matched elements. The result is
366
+ a string that contains the combined text contents of all matched
367
+ elements. This method works on both HTML and XML documents.</desc>
368
+ <examples>
369
+ <desc>Gets the concatenated text of all paragraphs</desc>
370
+ <before>&lt;p&gt;&lt;b&gt;Test&lt;/b&gt; Paragraph.&lt;/p&gt;&lt;p&gt;Paraparagraph&lt;/p&gt;</before>
371
+ <code>$("p").text();</code>
372
+ <result>Test Paragraph.Paraparagraph</result>
373
+ </examples>
374
+ </method>
375
+ <method cat='DOM/Attributes' type='String' short='Set the text contents of all matched elements.' name='text'>
376
+ <desc>Set the text contents of all matched elements.
377
+
378
+ Similar to html(), but escapes HTML (replace "&lt;" and "&gt;" with their
379
+ HTML entities).</desc>
380
+ <params type='String' name='val'>
381
+ <desc>The text value to set the contents of the element to.</desc>
382
+ </params>
383
+ <examples>
384
+ <desc>Sets the text of all paragraphs.</desc>
385
+ <before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
386
+ <code>$("p").text("&lt;b&gt;Some&lt;/b&gt; new text.");</code>
387
+ <result>&lt;p&gt;&amp;lt;b&amp;gt;Some&amp;lt;/b&amp;gt; new text.&lt;/p&gt;</result>
388
+ </examples>
389
+ <examples>
390
+ <desc>Sets the text of all paragraphs.</desc>
391
+ <before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
392
+ <code>$("p").text("&lt;b&gt;Some&lt;/b&gt; new text.", true);</code>
393
+ <result>&lt;p&gt;Some new text.&lt;/p&gt;</result>
394
+ </examples>
395
+ </method>
396
+ <method cat='DOM/Manipulation' type='jQuery' short='Wrap all matched elements with a structure of other elements.' name='wrap'>
397
+ <desc>Wrap all matched elements with a structure of other elements.
398
+ This wrapping process is most useful for injecting additional
399
+ stucture into a document, without ruining the original semantic
400
+ qualities of a document.
401
+
402
+ This works by going through the first element
403
+ provided (which is generated, on the fly, from the provided HTML)
404
+ and finds the deepest ancestor element within its
405
+ structure - it is that element that will en-wrap everything else.
406
+
407
+ This does not work with elements that contain text. Any necessary text
408
+ must be added after the wrapping is done.</desc>
409
+ <params type='String' name='html'>
410
+ <desc>A string of HTML, that will be created on the fly and wrapped around the target.</desc>
411
+ </params>
412
+ <examples>
413
+ <code>$("p").wrap("&lt;div class='wrap'&gt;&lt;/div&gt;");</code>
414
+ <result>&lt;div class='wrap'&gt;&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;/div&gt;</result>
415
+ <before>&lt;p&gt;Test Paragraph.&lt;/p&gt;</before>
416
+ </examples>
417
+ </method>
418
+ <method cat='DOM/Manipulation' type='jQuery' short='Wrap all matched elements with a structure of other elements.' name='wrap'>
419
+ <desc>Wrap all matched elements with a structure of other elements.
420
+ This wrapping process is most useful for injecting additional
421
+ stucture into a document, without ruining the original semantic
422
+ qualities of a document.
423
+
424
+ This works by going through the first element
425
+ provided and finding the deepest ancestor element within its
426
+ structure - it is that element that will en-wrap everything else.
427
+
428
+ This does not work with elements that contain text. Any necessary text
429
+ must be added after the wrapping is done.</desc>
430
+ <params type='Element' name='elem'>
431
+ <desc>A DOM element that will be wrapped around the target.</desc>
432
+ </params>
433
+ <examples>
434
+ <code>$("p").wrap( document.getElementById('content') );</code>
435
+ <result>&lt;div id="content"&gt;&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;/div&gt;</result>
436
+ <before>&lt;p&gt;Test Paragraph.&lt;/p&gt;&lt;div id="content"&gt;&lt;/div&gt;</before>
437
+ </examples>
438
+ </method>
439
+ <method cat='DOM/Manipulation' type='jQuery' short='Append content to the inside of every matched element.' name='append'>
440
+ <desc>Append content to the inside of every matched element.
441
+
442
+ This operation is similar to doing an appendChild to all the
443
+ specified elements, adding them into the document.</desc>
444
+ <see>prepend(&lt;Content&gt;)</see>
445
+ <see>before(&lt;Content&gt;)</see>
446
+ <see>after(&lt;Content&gt;)</see>
447
+ <params type='&lt;Content&gt;' name='content'>
448
+ <desc>Content to append to the target</desc>
449
+ </params>
450
+ <examples>
451
+ <desc>Appends some HTML to all paragraphs.</desc>
452
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;</before>
453
+ <code>$("p").append("&lt;b&gt;Hello&lt;/b&gt;");</code>
454
+ <result>&lt;p&gt;I would like to say: &lt;b&gt;Hello&lt;/b&gt;&lt;/p&gt;</result>
455
+ </examples>
456
+ <examples>
457
+ <desc>Appends an Element to all paragraphs.</desc>
458
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</before>
459
+ <code>$("p").append( $("#foo")[0] );</code>
460
+ <result>&lt;p&gt;I would like to say: &lt;b id="foo"&gt;Hello&lt;/b&gt;&lt;/p&gt;</result>
461
+ </examples>
462
+ <examples>
463
+ <desc>Appends a jQuery object (similar to an Array of DOM Elements) to all paragraphs.</desc>
464
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</before>
465
+ <code>$("p").append( $("b") );</code>
466
+ <result>&lt;p&gt;I would like to say: &lt;b&gt;Hello&lt;/b&gt;&lt;/p&gt;</result>
467
+ </examples>
468
+ </method>
469
+ <method cat='DOM/Manipulation' type='jQuery' short='Prepend content to the inside of every matched element.' name='prepend'>
470
+ <desc>Prepend content to the inside of every matched element.
471
+
472
+ This operation is the best way to insert elements
473
+ inside, at the beginning, of all matched elements.</desc>
474
+ <see>append(&lt;Content&gt;)</see>
475
+ <see>before(&lt;Content&gt;)</see>
476
+ <see>after(&lt;Content&gt;)</see>
477
+ <params type='&lt;Content&gt;' name='content'>
478
+ <desc>Content to prepend to the target.</desc>
479
+ </params>
480
+ <examples>
481
+ <desc>Prepends some HTML to all paragraphs.</desc>
482
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;</before>
483
+ <code>$("p").prepend("&lt;b&gt;Hello&lt;/b&gt;");</code>
484
+ <result>&lt;p&gt;&lt;b&gt;Hello&lt;/b&gt;I would like to say: &lt;/p&gt;</result>
485
+ </examples>
486
+ <examples>
487
+ <desc>Prepends an Element to all paragraphs.</desc>
488
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</before>
489
+ <code>$("p").prepend( $("#foo")[0] );</code>
490
+ <result>&lt;p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;I would like to say: &lt;/p&gt;</result>
491
+ </examples>
492
+ <examples>
493
+ <desc>Prepends a jQuery object (similar to an Array of DOM Elements) to all paragraphs.</desc>
494
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</before>
495
+ <code>$("p").prepend( $("b") );</code>
496
+ <result>&lt;p&gt;&lt;b&gt;Hello&lt;/b&gt;I would like to say: &lt;/p&gt;</result>
497
+ </examples>
498
+ </method>
499
+ <method cat='DOM/Manipulation' type='jQuery' short='Insert content before each of the matched elements.' name='before'>
500
+ <desc>Insert content before each of the matched elements.</desc>
501
+ <see>append(&lt;Content&gt;)</see>
502
+ <see>prepend(&lt;Content&gt;)</see>
503
+ <see>after(&lt;Content&gt;)</see>
504
+ <params type='&lt;Content&gt;' name='content'>
505
+ <desc>Content to insert before each target.</desc>
506
+ </params>
507
+ <examples>
508
+ <desc>Inserts some HTML before all paragraphs.</desc>
509
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;</before>
510
+ <code>$("p").before("&lt;b&gt;Hello&lt;/b&gt;");</code>
511
+ <result>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</result>
512
+ </examples>
513
+ <examples>
514
+ <desc>Inserts an Element before all paragraphs.</desc>
515
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</before>
516
+ <code>$("p").before( $("#foo")[0] );</code>
517
+ <result>&lt;b id="foo"&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</result>
518
+ </examples>
519
+ <examples>
520
+ <desc>Inserts a jQuery object (similar to an Array of DOM Elements) before all paragraphs.</desc>
521
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</before>
522
+ <code>$("p").before( $("b") );</code>
523
+ <result>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</result>
524
+ </examples>
525
+ </method>
526
+ <method cat='DOM/Manipulation' type='jQuery' short='Insert content after each of the matched elements.' name='after'>
527
+ <desc>Insert content after each of the matched elements.</desc>
528
+ <see>append(&lt;Content&gt;)</see>
529
+ <see>prepend(&lt;Content&gt;)</see>
530
+ <see>before(&lt;Content&gt;)</see>
531
+ <params type='&lt;Content&gt;' name='content'>
532
+ <desc>Content to insert after each target.</desc>
533
+ </params>
534
+ <examples>
535
+ <desc>Inserts some HTML after all paragraphs.</desc>
536
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;</before>
537
+ <code>$("p").after("&lt;b&gt;Hello&lt;/b&gt;");</code>
538
+ <result>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</result>
539
+ </examples>
540
+ <examples>
541
+ <desc>Inserts an Element after all paragraphs.</desc>
542
+ <before>&lt;b id="foo"&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</before>
543
+ <code>$("p").after( $("#foo")[0] );</code>
544
+ <result>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b id="foo"&gt;Hello&lt;/b&gt;</result>
545
+ </examples>
546
+ <examples>
547
+ <desc>Inserts a jQuery object (similar to an Array of DOM Elements) after all paragraphs.</desc>
548
+ <before>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</before>
549
+ <code>$("p").after( $("b") );</code>
550
+ <result>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;</result>
551
+ </examples>
552
+ </method>
553
+ <method cat='DOM/Traversing' type='jQuery' short='Revert the most recent &apos;destructive&apos; operation, changing the set of matched elements
554
+ to its previous state (right before the destructive operation).' name='end'>
555
+ <desc>Revert the most recent 'destructive' operation, changing the set of matched elements
556
+ to its previous state (right before the destructive operation).
557
+
558
+ If there was no destructive operation before, an empty set is returned.
559
+
560
+ A 'destructive' operation is any operation that changes the set of
561
+ matched jQuery elements. These functions are: &lt;code&gt;add&lt;/code&gt;,
562
+ &lt;code&gt;children&lt;/code&gt;, &lt;code&gt;clone&lt;/code&gt;, &lt;code&gt;filter&lt;/code&gt;,
563
+ &lt;code&gt;find&lt;/code&gt;, &lt;code&gt;not&lt;/code&gt;, &lt;code&gt;next&lt;/code&gt;,
564
+ &lt;code&gt;parent&lt;/code&gt;, &lt;code&gt;parents&lt;/code&gt;, &lt;code&gt;prev&lt;/code&gt; and &lt;code&gt;siblings&lt;/code&gt;.</desc>
565
+ <examples>
566
+ <desc>Selects all paragraphs, finds span elements inside these, and reverts the
567
+ selection back to the paragraphs.</desc>
568
+ <before>&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;, how are you?&lt;/p&gt;</before>
569
+ <code>$("p").find("span").end();</code>
570
+ <result>[ &lt;p&gt;...&lt;/p&gt; ]</result>
571
+ </examples>
572
+ </method>
573
+ <method cat='DOM/Traversing' type='jQuery' short='Searches for all elements that match the specified expression.' name='find'>
574
+ <desc>Searches for all elements that match the specified expression.
575
+ This method is a good way to find additional descendant
576
+ elements with which to process.
577
+
578
+ All searching is done using a jQuery expression. The expression can be
579
+ written using CSS 1-3 Selector syntax, or basic XPath.</desc>
580
+ <params type='String' name='expr'>
581
+ <desc>An expression to search with.</desc>
582
+ </params>
583
+ <examples>
584
+ <desc>Starts with all paragraphs and searches for descendant span
585
+ elements, same as $("p span")</desc>
586
+ <before>&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;, how are you?&lt;/p&gt;</before>
587
+ <code>$("p").find("span");</code>
588
+ <result>[ &lt;span&gt;Hello&lt;/span&gt; ]</result>
589
+ </examples>
590
+ </method>
591
+ <method cat='DOM/Manipulation' type='jQuery' short='Clone matched DOM Elements and select the clones.' name='clone'>
592
+ <desc>Clone matched DOM Elements and select the clones.
593
+
594
+ This is useful for moving copies of the elements to another
595
+ location in the DOM.</desc>
596
+ <params type='Boolean' name='deep'>
597
+ <desc>(Optional) Set to false if you don't want to clone all descendant nodes, in addition to the element itself.</desc>
598
+ </params>
599
+ <examples>
600
+ <desc>Clones all b elements (and selects the clones) and prepends them to all paragraphs.</desc>
601
+ <before>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;, how are you?&lt;/p&gt;</before>
602
+ <code>$("b").clone().prependTo("p");</code>
603
+ <result>&lt;b&gt;Hello&lt;/b&gt;&lt;p&gt;&lt;b&gt;Hello&lt;/b&gt;, how are you?&lt;/p&gt;</result>
604
+ </examples>
605
+ </method>
606
+ <method cat='DOM/Traversing' type='jQuery' short='Removes all elements from the set of matched elements that do not
607
+ match the specified expression(s).' name='filter'>
608
+ <desc>Removes all elements from the set of matched elements that do not
609
+ match the specified expression(s). This method is used to narrow down
610
+ the results of a search.
611
+
612
+ Provide a comma-separated list of expressions to apply multiple filters at once.</desc>
613
+ <params type='String' name='expression'>
614
+ <desc>Expression(s) to search with.</desc>
615
+ </params>
616
+ <examples>
617
+ <desc>Selects all paragraphs and removes those without a class "selected".</desc>
618
+ <before>&lt;p class="selected"&gt;Hello&lt;/p&gt;&lt;p&gt;How are you?&lt;/p&gt;</before>
619
+ <code>$("p").filter(".selected")</code>
620
+ <result>[ &lt;p class="selected"&gt;Hello&lt;/p&gt; ]</result>
621
+ </examples>
622
+ <examples>
623
+ <desc>Selects all paragraphs and removes those without class "selected" and being the first one.</desc>
624
+ <before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;Hello Again&lt;/p&gt;&lt;p class="selected"&gt;And Again&lt;/p&gt;</before>
625
+ <code>$("p").filter(".selected, :first")</code>
626
+ <result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;p class="selected"&gt;And Again&lt;/p&gt; ]</result>
627
+ </examples>
628
+ </method>
629
+ <method cat='DOM/Traversing' type='jQuery' short='Removes all elements from the set of matched elements that do not
630
+ pass the specified filter.' name='filter'>
631
+ <desc>Removes all elements from the set of matched elements that do not
632
+ pass the specified filter. This method is used to narrow down
633
+ the results of a search.</desc>
634
+ <params type='Function' name='filter'>
635
+ <desc>A function to use for filtering</desc>
636
+ </params>
637
+ <examples>
638
+ <desc>Remove all elements that have a child ol element</desc>
639
+ <before>&lt;p&gt;&lt;ol&gt;&lt;li&gt;Hello&lt;/li&gt;&lt;/ol&gt;&lt;/p&gt;&lt;p&gt;How are you?&lt;/p&gt;</before>
640
+ <code>$("p").filter(function(index) {
641
+ return $("ol", this).length == 0;
642
+ })</code>
643
+ <result>[ &lt;p&gt;How are you?&lt;/p&gt; ]</result>
644
+ </examples>
645
+ </method>
646
+ <method cat='DOM/Traversing' type='jQuery' short='Removes the specified Element from the set of matched elements.' name='not'>
647
+ <desc>Removes the specified Element from the set of matched elements. This
648
+ method is used to remove a single Element from a jQuery object.</desc>
649
+ <params type='Element' name='el'>
650
+ <desc>An element to remove from the set</desc>
651
+ </params>
652
+ <examples>
653
+ <desc>Removes the element with the ID "selected" from the set of all paragraphs.</desc>
654
+ <before>&lt;p&gt;Hello&lt;/p&gt;&lt;p id="selected"&gt;Hello Again&lt;/p&gt;</before>
655
+ <code>$("p").not( $("#selected")[0] )</code>
656
+ <result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
657
+ </examples>
658
+ </method>
659
+ <method cat='DOM/Traversing' type='jQuery' short='Removes elements matching the specified expression from the set
660
+ of matched elements.' name='not'>
661
+ <desc>Removes elements matching the specified expression from the set
662
+ of matched elements. This method is used to remove one or more
663
+ elements from a jQuery object.</desc>
664
+ <params type='String' name='expr'>
665
+ <desc>An expression with which to remove matching elements</desc>
666
+ </params>
667
+ <examples>
668
+ <desc>Removes the element with the ID "selected" from the set of all paragraphs.</desc>
669
+ <before>&lt;p&gt;Hello&lt;/p&gt;&lt;p id="selected"&gt;Hello Again&lt;/p&gt;</before>
670
+ <code>$("p").not("#selected")</code>
671
+ <result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
672
+ </examples>
673
+ </method>
674
+ <method cat='DOM/Traversing' type='jQuery' short='Removes any elements inside the array of elements from the set
675
+ of matched elements.' name='not'>
676
+ <desc>Removes any elements inside the array of elements from the set
677
+ of matched elements. This method is used to remove one or more
678
+ elements from a jQuery object.
679
+
680
+ Please note: the expression cannot use a reference to the
681
+ element name. See the two examples below.</desc>
682
+ <params type='jQuery' name='elems'>
683
+ <desc>A set of elements to remove from the jQuery set of matched elements.</desc>
684
+ </params>
685
+ <examples>
686
+ <desc>Removes all elements that match "div p.selected" from the total set of all paragraphs.</desc>
687
+ <before>&lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;&lt;/div&gt;</before>
688
+ <code>$("p").not( $("div p.selected") )</code>
689
+ <result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
690
+ </examples>
691
+ </method>
692
+ <method cat='DOM/Traversing' type='jQuery' short='Adds more elements, matched by the given expression,
693
+ to the set of matched elements.' name='add'>
694
+ <desc>Adds more elements, matched by the given expression,
695
+ to the set of matched elements.</desc>
696
+ <params type='String' name='expr'>
697
+ <desc>An expression whose matched elements are added</desc>
698
+ </params>
699
+ <examples>
700
+ <desc>Compare the above result to the result of &lt;code&gt;$('p')&lt;/code&gt;,
701
+ which would just result in &lt;code&gt;&lt;nowiki&gt;[ &lt;p&gt;Hello&lt;/p&gt; ]&lt;/nowiki&gt;&lt;/code&gt;.
702
+ Using add(), matched elements of &lt;code&gt;$('span')&lt;/code&gt; are simply
703
+ added to the returned jQuery-object.</desc>
704
+ <before>(HTML) &lt;p&gt;Hello&lt;/p&gt;&lt;span&gt;Hello Again&lt;/span&gt;</before>
705
+ <code>$("p").add("span")</code>
706
+ <result>(jQuery object matching 2 elements) [ &lt;p&gt;Hello&lt;/p&gt;, &lt;span&gt;Hello Again&lt;/span&gt; ]</result>
707
+ </examples>
708
+ </method>
709
+ <method cat='DOM/Traversing' type='jQuery' short='Adds more elements, created on the fly, to the set of
710
+ matched elements.' name='add'>
711
+ <desc>Adds more elements, created on the fly, to the set of
712
+ matched elements.</desc>
713
+ <params type='String' name='html'>
714
+ <desc>A string of HTML to create on the fly.</desc>
715
+ </params>
716
+ <examples>
717
+ <code>$("p").add("&lt;span&gt;Again&lt;/span&gt;")</code>
718
+ <result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;span&gt;Again&lt;/span&gt; ]</result>
719
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
720
+ </examples>
721
+ </method>
722
+ <method cat='DOM/Traversing' type='jQuery' short='Adds one or more Elements to the set of matched elements.' name='add'>
723
+ <desc>Adds one or more Elements to the set of matched elements.</desc>
724
+ <params type='Element|Array&lt;Element&gt;' name='elements'>
725
+ <desc>One or more Elements to add</desc>
726
+ </params>
727
+ <examples>
728
+ <code>$("p").add( document.getElementById("a") )</code>
729
+ <result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;span id="a"&gt;Hello Again&lt;/span&gt; ]</result>
730
+ <before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;&lt;span id="a"&gt;Hello Again&lt;/span&gt;&lt;/p&gt;</before>
731
+ </examples>
732
+ <examples>
733
+ <code>$("p").add( document.forms[0].elements )</code>
734
+ <result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;input/&gt;, &lt;button/&gt; ]</result>
735
+ <before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;&lt;form&gt;&lt;input/&gt;&lt;button/&gt;&lt;/form&gt;</before>
736
+ </examples>
737
+ </method>
738
+ <method cat='DOM/Traversing' type='Boolean' short='Checks the current selection against an expression and returns true,
739
+ if at least one element of the selection fits the given expression.' name='is'>
740
+ <desc>Checks the current selection against an expression and returns true,
741
+ if at least one element of the selection fits the given expression.
742
+
743
+ Does return false, if no element fits or the expression is not valid.
744
+
745
+ filter(String) is used internally, therefore all rules that apply there
746
+ apply here, too.</desc>
747
+ <params type='String' name='expr'>
748
+ <desc>The expression with which to filter</desc>
749
+ </params>
750
+ <examples>
751
+ <desc>Returns true, because the parent of the input is a form element</desc>
752
+ <before>&lt;form&gt;&lt;input type="checkbox" /&gt;&lt;/form&gt;</before>
753
+ <code>$("input[@type='checkbox']").parent().is("form")</code>
754
+ <result>true</result>
755
+ </examples>
756
+ <examples>
757
+ <desc>Returns false, because the parent of the input is a p element</desc>
758
+ <before>&lt;form&gt;&lt;p&gt;&lt;input type="checkbox" /&gt;&lt;/p&gt;&lt;/form&gt;</before>
759
+ <code>$("input[@type='checkbox']").parent().is("form")</code>
760
+ <result>false</result>
761
+ </examples>
762
+ </method>
763
+ <method cat='DOM/Attributes' type='String' short='Get the content of the value attribute of the first matched element.' name='val'>
764
+ <desc>Get the content of the value attribute of the first matched element.
765
+
766
+ Use caution when relying on this function to check the value of
767
+ multiple-select elements and checkboxes in a form. While it will
768
+ still work as intended, it may not accurately represent the value
769
+ the server will receive because these elements may send an array
770
+ of values. For more robust handling of field values, see the
771
+ [http://www.malsup.com/jquery/form/#fields fieldValue function of the Form Plugin].</desc>
772
+ <examples>
773
+ <code>$("input").val();</code>
774
+ <result>"some text"</result>
775
+ <before>&lt;input type="text" value="some text"/&gt;</before>
776
+ </examples>
777
+ </method>
778
+ <method cat='DOM/Attributes' type='jQuery' short=' Set the value attribute of every matched element.' name='val'>
779
+ <desc> Set the value attribute of every matched element.</desc>
780
+ <params type='String' name='val'>
781
+ <desc>Set the property to the specified value.</desc>
782
+ </params>
783
+ <examples>
784
+ <code>$("input").val("test");</code>
785
+ <result>&lt;input type="text" value="test"/&gt;</result>
786
+ <before>&lt;input type="text" value="some text"/&gt;</before>
787
+ </examples>
788
+ </method>
789
+ <method cat='DOM/Attributes' type='String' short='Get the html contents of the first matched element.' name='html'>
790
+ <desc>Get the html contents of the first matched element.
791
+ This property is not available on XML documents.</desc>
792
+ <examples>
793
+ <code>$("div").html();</code>
794
+ <result>&lt;input/&gt;</result>
795
+ <before>&lt;div&gt;&lt;input/&gt;&lt;/div&gt;</before>
796
+ </examples>
797
+ </method>
798
+ <method cat='DOM/Attributes' type='jQuery' short='Set the html contents of every matched element.' name='html'>
799
+ <desc>Set the html contents of every matched element.
800
+ This property is not available on XML documents.</desc>
801
+ <params type='String' name='val'>
802
+ <desc>Set the html contents to the specified value.</desc>
803
+ </params>
804
+ <examples>
805
+ <code>$("div").html("&lt;b&gt;new stuff&lt;/b&gt;");</code>
806
+ <result>&lt;div&gt;&lt;b&gt;new stuff&lt;/b&gt;&lt;/div&gt;</result>
807
+ <before>&lt;div&gt;&lt;input/&gt;&lt;/div&gt;</before>
808
+ </examples>
809
+ </method>
810
+ <method cat='Core' type='jQuery' short='' name='domManip' private='1'>
811
+ <desc></desc>
812
+ <params type='Array' name='args'>
813
+ <desc></desc>
814
+ </params>
815
+ <params type='Boolean' name='table'>
816
+ <desc>Insert TBODY in TABLEs if one is not found.</desc>
817
+ </params>
818
+ <params type='Number' name='dir'>
819
+ <desc>If dir&lt;0, process args in reverse order.</desc>
820
+ </params>
821
+ <params type='Function' name='fn'>
822
+ <desc>The function doing the DOM manipulation.</desc>
823
+ </params>
824
+ </method>
825
+ <method cat='Core' type='Object' short='Extends the jQuery object itself.' name='$.extend'>
826
+ <desc>Extends the jQuery object itself. Can be used to add functions into
827
+ the jQuery namespace and to [[Plugins/Authoring|add plugin methods]] (plugins).</desc>
828
+ <params type='Object' name='prop'>
829
+ <desc>The object that will be merged into the jQuery object</desc>
830
+ </params>
831
+ <examples>
832
+ <desc>Adds two plugin methods.</desc>
833
+ <code>jQuery.fn.extend({
834
+ check: function() {
835
+ return this.each(function() { this.checked = true; });
836
+ },
837
+ uncheck: function() {
838
+ return this.each(function() { this.checked = false; });
839
+ }
840
+ });
841
+ $("input[@type=checkbox]").check();
842
+ $("input[@type=radio]").uncheck();</code>
843
+ </examples>
844
+ <examples>
845
+ <desc>Adds two functions into the jQuery namespace</desc>
846
+ <code>jQuery.extend({
847
+ min: function(a, b) { return a &lt; b ? a : b; },
848
+ max: function(a, b) { return a &gt; b ? a : b; }
849
+ });</code>
850
+ </examples>
851
+ </method>
852
+ <method cat='JavaScript' type='Object' short='Extend one object with one or more others, returning the original,
853
+ modified, object.' name='$.extend'>
854
+ <desc>Extend one object with one or more others, returning the original,
855
+ modified, object. This is a great utility for simple inheritance.</desc>
856
+ <params type='Object' name='target'>
857
+ <desc>The object to extend</desc>
858
+ </params>
859
+ <params type='Object' name='prop1'>
860
+ <desc>The object that will be merged into the first.</desc>
861
+ </params>
862
+ <params type='Object' name='propN'>
863
+ <desc>(optional) More objects to merge into the first</desc>
864
+ </params>
865
+ <examples>
866
+ <desc>Merge settings and options, modifying settings</desc>
867
+ <code>var settings = { validate: false, limit: 5, name: "foo" };
868
+ var options = { validate: true, name: "bar" };
869
+ jQuery.extend(settings, options);</code>
870
+ <result>settings == { validate: true, limit: 5, name: "bar" }</result>
871
+ </examples>
872
+ <examples>
873
+ <desc>Merge defaults and options, without modifying the defaults</desc>
874
+ <code>var defaults = { validate: false, limit: 5, name: "foo" };
875
+ var options = { validate: true, name: "bar" };
876
+ var settings = jQuery.extend({}, defaults, options);</code>
877
+ <result>settings == { validate: true, limit: 5, name: "bar" }</result>
878
+ </examples>
879
+ </method>
880
+ <method cat='Core' type='undefined' short='Run this function to give control of the $ variable back
881
+ to whichever library first implemented it.' name='$.noConflict'>
882
+ <desc>Run this function to give control of the $ variable back
883
+ to whichever library first implemented it. This helps to make
884
+ sure that jQuery doesn't conflict with the $ object
885
+ of other libraries.
886
+
887
+ By using this function, you will only be able to access jQuery
888
+ using the 'jQuery' variable. For example, where you used to do
889
+ $("div p"), you now must do jQuery("div p").</desc>
890
+ <examples>
891
+ <desc>Maps the original object that was referenced by $ back to $</desc>
892
+ <code>jQuery.noConflict();
893
+ // Do something with jQuery
894
+ jQuery("div p").hide();
895
+ // Do something with another library's $()
896
+ $("content").style.display = 'none';</code>
897
+ </examples>
898
+ <examples>
899
+ <desc>Reverts the $ alias and then creates and executes a
900
+ function to provide the $ as a jQuery alias inside the functions
901
+ scope. Inside the function the original $ object is not available.
902
+ This works well for most plugins that don't rely on any other library.</desc>
903
+ <code>jQuery.noConflict();
904
+ (function($) {
905
+ $(function() {
906
+ // more code using $ as alias to jQuery
907
+ });
908
+ })(jQuery);
909
+ // other code using $ as an alias to the other library</code>
910
+ </examples>
911
+ </method>
912
+ <method cat='JavaScript' type='Object' short='A generic iterator function, which can be used to seamlessly
913
+ iterate over both objects and arrays.' name='$.each'>
914
+ <desc>A generic iterator function, which can be used to seamlessly
915
+ iterate over both objects and arrays. This function is not the same
916
+ as $().each() - which is used to iterate, exclusively, over a jQuery
917
+ object. This function can be used to iterate over anything.
918
+
919
+ The callback has two arguments:the key (objects) or index (arrays) as first
920
+ the first, and the value as the second.</desc>
921
+ <params type='Object' name='obj'>
922
+ <desc>The object, or array, to iterate over.</desc>
923
+ </params>
924
+ <params type='Function' name='fn'>
925
+ <desc>The function that will be executed on every object.</desc>
926
+ </params>
927
+ <examples>
928
+ <desc>This is an example of iterating over the items in an array,
929
+ accessing both the current item and its index.</desc>
930
+ <code>$.each( [0,1,2], function(i, n){
931
+ alert( "Item #" + i + ": " + n );
932
+ });</code>
933
+ </examples>
934
+ <examples>
935
+ <desc>This is an example of iterating over the properties in an
936
+ Object, accessing both the current item and its key.</desc>
937
+ <code>$.each( { name: "John", lang: "JS" }, function(i, n){
938
+ alert( "Name: " + i + ", Value: " + n );
939
+ });</code>
940
+ </examples>
941
+ </method>
942
+ <method cat='JavaScript' type='String' short='Remove the whitespace from the beginning and end of a string.' name='$.trim'>
943
+ <desc>Remove the whitespace from the beginning and end of a string.</desc>
944
+ <params type='String' name='str'>
945
+ <desc>The string to trim.</desc>
946
+ </params>
947
+ <examples>
948
+ <code>$.trim(" hello, how are you? ");</code>
949
+ <result>"hello, how are you?"</result>
950
+ </examples>
951
+ </method>
952
+ <method cat='JavaScript' type='Array' short='Merge two arrays together by concatenating them.' name='$.merge'>
953
+ <desc>Merge two arrays together by concatenating them.</desc>
954
+ <params type='Array' name='first'>
955
+ <desc>The first array to merge, the elements of second are added.</desc>
956
+ </params>
957
+ <params type='Array' name='second'>
958
+ <desc>The second array to append to the first, unaltered.</desc>
959
+ </params>
960
+ <examples>
961
+ <desc>Merges two arrays.</desc>
962
+ <code>$.merge( [0,1,2], [2,3,4] )</code>
963
+ <result>[0,1,2,2,3,4]</result>
964
+ </examples>
965
+ </method>
966
+ <method cat='JavaScript' type='Array' short='Reduce an array (of jQuery objects only) to its unique elements.' name='$.unique'>
967
+ <desc>Reduce an array (of jQuery objects only) to its unique elements.</desc>
968
+ <params type='Array' name='array'>
969
+ <desc>The array to reduce to its unique jQuery objects.</desc>
970
+ </params>
971
+ <examples>
972
+ <desc>Reduces the arrays of jQuery objects to unique elements by removing the duplicates of x2 and x3</desc>
973
+ <code>$.unique( [x1, x2, x3, x2, x3] )</code>
974
+ <result>[x1, x2, x3]</result>
975
+ </examples>
976
+ </method>
977
+ <method cat='JavaScript' type='Array' short='Filter items out of an array, by using a filter function.' name='$.grep'>
978
+ <desc>Filter items out of an array, by using a filter function.
979
+
980
+ The specified function will be passed two arguments: The
981
+ current array item and the index of the item in the array. The
982
+ function must return 'true' to keep the item in the array,
983
+ false to remove it.</desc>
984
+ <params type='Array' name='array'>
985
+ <desc>The Array to find items in.</desc>
986
+ </params>
987
+ <params type='Function' name='fn'>
988
+ <desc>The function to process each item against.</desc>
989
+ </params>
990
+ <params type='Boolean' name='inv'>
991
+ <desc>Invert the selection - select the opposite of the function.</desc>
992
+ </params>
993
+ <examples>
994
+ <code>$.grep( [0,1,2], function(i){
995
+ return i &gt; 0;
996
+ });</code>
997
+ <result>[1, 2]</result>
998
+ </examples>
999
+ </method>
1000
+ <method cat='JavaScript' type='Array' short='Translate all items in an array to another array of items.' name='$.map'>
1001
+ <desc>Translate all items in an array to another array of items.
1002
+
1003
+ The translation function that is provided to this method is
1004
+ called for each item in the array and is passed one argument:
1005
+ The item to be translated.
1006
+
1007
+ The function can then return the translated value, 'null'
1008
+ (to remove the item), or an array of values - which will
1009
+ be flattened into the full array.</desc>
1010
+ <params type='Array' name='array'>
1011
+ <desc>The Array to translate.</desc>
1012
+ </params>
1013
+ <params type='Function' name='fn'>
1014
+ <desc>The function to process each item against.</desc>
1015
+ </params>
1016
+ <examples>
1017
+ <desc>Maps the original array to a new one and adds 4 to each value.</desc>
1018
+ <code>$.map( [0,1,2], function(i){
1019
+ return i + 4;
1020
+ });</code>
1021
+ <result>[4, 5, 6]</result>
1022
+ </examples>
1023
+ <examples>
1024
+ <desc>Maps the original array to a new one and adds 1 to each
1025
+ value if it is bigger then zero, otherwise it's removed-</desc>
1026
+ <code>$.map( [0,1,2], function(i){
1027
+ return i &gt; 0 ? i + 1 : null;
1028
+ });</code>
1029
+ <result>[2, 3]</result>
1030
+ </examples>
1031
+ <examples>
1032
+ <desc>Maps the original array to a new one, each element is added
1033
+ with it's original value and the value plus one.</desc>
1034
+ <code>$.map( [0,1,2], function(i){
1035
+ return [ i, i + 1 ];
1036
+ });</code>
1037
+ <result>[0, 1, 1, 2, 2, 3]</result>
1038
+ </examples>
1039
+ </method>
1040
+ <method property='1' cat='JavaScript' type='Boolean' short='Contains flags for the useragent, read from navigator.' name='$.browser'>
1041
+ <desc>Contains flags for the useragent, read from navigator.userAgent.
1042
+ Available flags are: safari, opera, msie, mozilla
1043
+
1044
+ This property is available before the DOM is ready, therefore you can
1045
+ use it to add ready events only for certain browsers.
1046
+
1047
+ There are situations where object detections is not reliable enough, in that
1048
+ cases it makes sense to use browser detection. Simply try to avoid both!
1049
+
1050
+ A combination of browser and object detection yields quite reliable results.</desc>
1051
+ <examples>
1052
+ <desc>Returns true if the current useragent is some version of microsoft's internet explorer</desc>
1053
+ <code>$.browser.msie</code>
1054
+ </examples>
1055
+ <examples>
1056
+ <desc>Alerts "this is safari!" only for safari browsers</desc>
1057
+ <code>if($.browser.safari) { $( function() { alert("this is safari!"); } ); }</code>
1058
+ </examples>
1059
+ </method>
1060
+ <method cat='DOM/Traversing' type='jQuery' short='Get a set of elements containing the unique parents of the matched
1061
+ set of elements.' name='parent'>
1062
+ <desc>Get a set of elements containing the unique parents of the matched
1063
+ set of elements.
1064
+
1065
+ You may use an optional expression to filter the set of parent elements that will match.</desc>
1066
+ <params type='String' name='expr'>
1067
+ <desc>(optional) An expression to filter the parents with</desc>
1068
+ </params>
1069
+ <examples>
1070
+ <desc>Find the parent element of each paragraph.</desc>
1071
+ <before>&lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt;</before>
1072
+ <code>$("p").parent()</code>
1073
+ <result>[ &lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt; ]</result>
1074
+ </examples>
1075
+ <examples>
1076
+ <desc>Find the parent element of each paragraph with a class "selected".</desc>
1077
+ <before>&lt;div&gt;&lt;p&gt;Hello&lt;/p&gt;&lt;/div&gt;&lt;div class="selected"&gt;&lt;p&gt;Hello Again&lt;/p&gt;&lt;/div&gt;</before>
1078
+ <code>$("p").parent(".selected")</code>
1079
+ <result>[ &lt;div class="selected"&gt;&lt;p&gt;Hello Again&lt;/p&gt;&lt;/div&gt; ]</result>
1080
+ </examples>
1081
+ </method>
1082
+ <method cat='DOM/Traversing' type='jQuery' short='Get a set of elements containing the unique ancestors of the matched
1083
+ set of elements (except for the root element).' name='parents'>
1084
+ <desc>Get a set of elements containing the unique ancestors of the matched
1085
+ set of elements (except for the root element).
1086
+
1087
+ The matched elements can be filtered with an optional expression.</desc>
1088
+ <params type='String' name='expr'>
1089
+ <desc>(optional) An expression to filter the ancestors with</desc>
1090
+ </params>
1091
+ <examples>
1092
+ <desc>Find all parent elements of each span.</desc>
1093
+ <before>&lt;html&gt;&lt;body&gt;&lt;div&gt;&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/p&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</before>
1094
+ <code>$("span").parents()</code>
1095
+ <result>[ &lt;body&gt;...&lt;/body&gt;, &lt;div&gt;...&lt;/div&gt;, &lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/p&gt; ]</result>
1096
+ </examples>
1097
+ <examples>
1098
+ <desc>Find all parent elements of each span that is a paragraph.</desc>
1099
+ <before>&lt;html&gt;&lt;body&gt;&lt;div&gt;&lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/p&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</before>
1100
+ <code>$("span").parents("p")</code>
1101
+ <result>[ &lt;p&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/p&gt; ]</result>
1102
+ </examples>
1103
+ </method>
1104
+ <method cat='DOM/Traversing' type='jQuery' short='Get a set of elements containing the unique next siblings of each of the
1105
+ matched set of elements.' name='next'>
1106
+ <desc>Get a set of elements containing the unique next siblings of each of the
1107
+ matched set of elements.
1108
+
1109
+ It only returns the very next sibling for each element, not all
1110
+ next siblings.
1111
+
1112
+ You may provide an optional expression to filter the match.</desc>
1113
+ <params type='String' name='expr'>
1114
+ <desc>(optional) An expression to filter the next Elements with</desc>
1115
+ </params>
1116
+ <examples>
1117
+ <desc>Find the very next sibling of each paragraph.</desc>
1118
+ <before>&lt;p&gt;Hello&lt;/p&gt;&lt;p&gt;Hello Again&lt;/p&gt;&lt;div&gt;&lt;span&gt;And Again&lt;/span&gt;&lt;/div&gt;</before>
1119
+ <code>$("p").next()</code>
1120
+ <result>[ &lt;p&gt;Hello Again&lt;/p&gt;, &lt;div&gt;&lt;span&gt;And Again&lt;/span&gt;&lt;/div&gt; ]</result>
1121
+ </examples>
1122
+ <examples>
1123
+ <desc>Find the very next sibling of each paragraph that has a class "selected".</desc>
1124
+ <before>&lt;p&gt;Hello&lt;/p&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;&lt;div&gt;&lt;span&gt;And Again&lt;/span&gt;&lt;/div&gt;</before>
1125
+ <code>$("p").next(".selected")</code>
1126
+ <result>[ &lt;p class="selected"&gt;Hello Again&lt;/p&gt; ]</result>
1127
+ </examples>
1128
+ </method>
1129
+ <method cat='DOM/Traversing' type='jQuery' short='Get a set of elements containing the unique previous siblings of each of the
1130
+ matched set of elements.' name='prev'>
1131
+ <desc>Get a set of elements containing the unique previous siblings of each of the
1132
+ matched set of elements.
1133
+
1134
+ Use an optional expression to filter the matched set.
1135
+
1136
+ Only the immediately previous sibling is returned, not all previous siblings.</desc>
1137
+ <params type='String' name='expr'>
1138
+ <desc>(optional) An expression to filter the previous Elements with</desc>
1139
+ </params>
1140
+ <examples>
1141
+ <desc>Find the very previous sibling of each paragraph.</desc>
1142
+ <before>&lt;p&gt;Hello&lt;/p&gt;&lt;div&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt;&lt;p&gt;And Again&lt;/p&gt;</before>
1143
+ <code>$("p").prev()</code>
1144
+ <result>[ &lt;div&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt; ]</result>
1145
+ </examples>
1146
+ <examples>
1147
+ <desc>Find the very previous sibling of each paragraph that has a class "selected".</desc>
1148
+ <before>&lt;div&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/div&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;&lt;p&gt;And Again&lt;/p&gt;</before>
1149
+ <code>$("p").prev(".selected")</code>
1150
+ <result>[ &lt;div&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/div&gt; ]</result>
1151
+ </examples>
1152
+ </method>
1153
+ <method cat='DOM/Traversing' type='jQuery' short='Get a set of elements containing all of the unique siblings of each of the
1154
+ matched set of elements.' name='siblings'>
1155
+ <desc>Get a set of elements containing all of the unique siblings of each of the
1156
+ matched set of elements.
1157
+
1158
+ Can be filtered with an optional expressions.</desc>
1159
+ <params type='String' name='expr'>
1160
+ <desc>(optional) An expression to filter the sibling Elements with</desc>
1161
+ </params>
1162
+ <examples>
1163
+ <desc>Find all siblings of each div.</desc>
1164
+ <before>&lt;p&gt;Hello&lt;/p&gt;&lt;div&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt;&lt;p&gt;And Again&lt;/p&gt;</before>
1165
+ <code>$("div").siblings()</code>
1166
+ <result>[ &lt;p&gt;Hello&lt;/p&gt;, &lt;p&gt;And Again&lt;/p&gt; ]</result>
1167
+ </examples>
1168
+ <examples>
1169
+ <desc>Find all siblings with a class "selected" of each div.</desc>
1170
+ <before>&lt;div&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;/div&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;&lt;p&gt;And Again&lt;/p&gt;</before>
1171
+ <code>$("div").siblings(".selected")</code>
1172
+ <result>[ &lt;p class="selected"&gt;Hello Again&lt;/p&gt; ]</result>
1173
+ </examples>
1174
+ </method>
1175
+ <method cat='DOM/Traversing' type='jQuery' short='Get a set of elements containing all of the unique children of each of the
1176
+ matched set of elements.' name='children'>
1177
+ <desc>Get a set of elements containing all of the unique children of each of the
1178
+ matched set of elements.
1179
+
1180
+ This set can be filtered with an optional expression that will cause
1181
+ only elements matching the selector to be collected.</desc>
1182
+ <params type='String' name='expr'>
1183
+ <desc>(optional) An expression to filter the child Elements with</desc>
1184
+ </params>
1185
+ <examples>
1186
+ <desc>Find all children of each div.</desc>
1187
+ <before>&lt;p&gt;Hello&lt;/p&gt;&lt;div&gt;&lt;span&gt;Hello Again&lt;/span&gt;&lt;/div&gt;&lt;p&gt;And Again&lt;/p&gt;</before>
1188
+ <code>$("div").children()</code>
1189
+ <result>[ &lt;span&gt;Hello Again&lt;/span&gt; ]</result>
1190
+ </examples>
1191
+ <examples>
1192
+ <desc>Find all children with a class "selected" of each div.</desc>
1193
+ <before>&lt;div&gt;&lt;span&gt;Hello&lt;/span&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;&lt;p&gt;And Again&lt;/p&gt;&lt;/div&gt;</before>
1194
+ <code>$("div").children(".selected")</code>
1195
+ <result>[ &lt;p class="selected"&gt;Hello Again&lt;/p&gt; ]</result>
1196
+ </examples>
1197
+ </method>
1198
+ <method cat='DOM/Manipulation' type='jQuery' see='append(&lt;Content&gt;)' short='Append all of the matched elements to another, specified, set of elements.' name='appendTo'>
1199
+ <desc>Append all of the matched elements to another, specified, set of elements.
1200
+ This operation is, essentially, the reverse of doing a regular
1201
+ $(A).append(B), in that instead of appending B to A, you're appending
1202
+ A to B.</desc>
1203
+ <params type='&lt;Content&gt;' name='content'>
1204
+ <desc>Content to append to the selected element to.</desc>
1205
+ </params>
1206
+ <examples>
1207
+ <desc>Appends all paragraphs to the element with the ID "foo"</desc>
1208
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;div id="foo"&gt;&lt;/div&gt;</before>
1209
+ <code>$("p").appendTo("#foo");</code>
1210
+ <result>&lt;div id="foo"&gt;&lt;p&gt;I would like to say: &lt;/p&gt;&lt;/div&gt;</result>
1211
+ </examples>
1212
+ </method>
1213
+ <method cat='DOM/Manipulation' type='jQuery' see='prepend(&lt;Content&gt;)' short='Prepend all of the matched elements to another, specified, set of elements.' name='prependTo'>
1214
+ <desc>Prepend all of the matched elements to another, specified, set of elements.
1215
+ This operation is, essentially, the reverse of doing a regular
1216
+ $(A).prepend(B), in that instead of prepending B to A, you're prepending
1217
+ A to B.</desc>
1218
+ <params type='&lt;Content&gt;' name='content'>
1219
+ <desc>Content to prepend to the selected element to.</desc>
1220
+ </params>
1221
+ <examples>
1222
+ <desc>Prepends all paragraphs to the element with the ID "foo"</desc>
1223
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;div id="foo"&gt;&lt;b&gt;Hello&lt;/b&gt;&lt;/div&gt;</before>
1224
+ <code>$("p").prependTo("#foo");</code>
1225
+ <result>&lt;div id="foo"&gt;&lt;p&gt;I would like to say: &lt;/p&gt;&lt;b&gt;Hello&lt;/b&gt;&lt;/div&gt;</result>
1226
+ </examples>
1227
+ </method>
1228
+ <method cat='DOM/Manipulation' type='jQuery' see='before(&lt;Content&gt;)' short='Insert all of the matched elements before another, specified, set of elements.' name='insertBefore'>
1229
+ <desc>Insert all of the matched elements before another, specified, set of elements.
1230
+ This operation is, essentially, the reverse of doing a regular
1231
+ $(A).before(B), in that instead of inserting B before A, you're inserting
1232
+ A before B.</desc>
1233
+ <params type='&lt;Content&gt;' name='content'>
1234
+ <desc>Content to insert the selected element before.</desc>
1235
+ </params>
1236
+ <examples>
1237
+ <desc>Same as $("#foo").before("p")</desc>
1238
+ <before>&lt;div id="foo"&gt;Hello&lt;/div&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</before>
1239
+ <code>$("p").insertBefore("#foo");</code>
1240
+ <result>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;div id="foo"&gt;Hello&lt;/div&gt;</result>
1241
+ </examples>
1242
+ </method>
1243
+ <method cat='DOM/Manipulation' type='jQuery' see='after(&lt;Content&gt;)' short='Insert all of the matched elements after another, specified, set of elements.' name='insertAfter'>
1244
+ <desc>Insert all of the matched elements after another, specified, set of elements.
1245
+ This operation is, essentially, the reverse of doing a regular
1246
+ $(A).after(B), in that instead of inserting B after A, you're inserting
1247
+ A after B.</desc>
1248
+ <params type='&lt;Content&gt;' name='content'>
1249
+ <desc>Content to insert the selected element after.</desc>
1250
+ </params>
1251
+ <examples>
1252
+ <desc>Same as $("#foo").after("p")</desc>
1253
+ <before>&lt;p&gt;I would like to say: &lt;/p&gt;&lt;div id="foo"&gt;Hello&lt;/div&gt;</before>
1254
+ <code>$("p").insertAfter("#foo");</code>
1255
+ <result>&lt;div id="foo"&gt;Hello&lt;/div&gt;&lt;p&gt;I would like to say: &lt;/p&gt;</result>
1256
+ </examples>
1257
+ </method>
1258
+ <method cat='DOM/Attributes' type='jQuery' short='Remove an attribute from each of the matched elements.' name='removeAttr'>
1259
+ <desc>Remove an attribute from each of the matched elements.</desc>
1260
+ <params type='String' name='name'>
1261
+ <desc>The name of the attribute to remove.</desc>
1262
+ </params>
1263
+ <examples>
1264
+ <code>$("input").removeAttr("disabled")</code>
1265
+ <result>&lt;input/&gt;</result>
1266
+ <before>&lt;input disabled="disabled"/&gt;</before>
1267
+ </examples>
1268
+ </method>
1269
+ <method cat='DOM/Attributes' type='jQuery' see='removeClass(String)' short='Adds the specified class(es) to each of the set of matched elements.' name='addClass'>
1270
+ <desc>Adds the specified class(es) to each of the set of matched elements.</desc>
1271
+ <params type='String' name='class'>
1272
+ <desc>One or more CSS classes to add to the elements</desc>
1273
+ </params>
1274
+ <examples>
1275
+ <code>$("p").addClass("selected")</code>
1276
+ <result>[ &lt;p class="selected"&gt;Hello&lt;/p&gt; ]</result>
1277
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1278
+ </examples>
1279
+ <examples>
1280
+ <code>$("p").addClass("selected highlight")</code>
1281
+ <result>[ &lt;p class="selected highlight"&gt;Hello&lt;/p&gt; ]</result>
1282
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1283
+ </examples>
1284
+ </method>
1285
+ <method cat='DOM/Attributes' type='jQuery' see='addClass(String)' short='Removes all or the specified class(es) from the set of matched elements.' name='removeClass'>
1286
+ <desc>Removes all or the specified class(es) from the set of matched elements.</desc>
1287
+ <params type='String' name='class'>
1288
+ <desc>(optional) One or more CSS classes to remove from the elements</desc>
1289
+ </params>
1290
+ <examples>
1291
+ <code>$("p").removeClass()</code>
1292
+ <result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
1293
+ <before>&lt;p class="selected"&gt;Hello&lt;/p&gt;</before>
1294
+ </examples>
1295
+ <examples>
1296
+ <code>$("p").removeClass("selected")</code>
1297
+ <result>[ &lt;p class="first"&gt;Hello&lt;/p&gt; ]</result>
1298
+ <before>&lt;p class="selected first"&gt;Hello&lt;/p&gt;</before>
1299
+ </examples>
1300
+ <examples>
1301
+ <code>$("p").removeClass("selected highlight")</code>
1302
+ <result>[ &lt;p class="first"&gt;Hello&lt;/p&gt; ]</result>
1303
+ <before>&lt;p class="highlight selected first"&gt;Hello&lt;/p&gt;</before>
1304
+ </examples>
1305
+ </method>
1306
+ <method cat='DOM/Attributes' type='jQuery' short='Adds the specified class if it is not present, removes it if it is
1307
+ present.' name='toggleClass'>
1308
+ <desc>Adds the specified class if it is not present, removes it if it is
1309
+ present.</desc>
1310
+ <params type='String' name='class'>
1311
+ <desc>A CSS class with which to toggle the elements</desc>
1312
+ </params>
1313
+ <examples>
1314
+ <code>$("p").toggleClass("selected")</code>
1315
+ <result>[ &lt;p class="selected"&gt;Hello&lt;/p&gt;, &lt;p&gt;Hello Again&lt;/p&gt; ]</result>
1316
+ <before>&lt;p&gt;Hello&lt;/p&gt;&lt;p class="selected"&gt;Hello Again&lt;/p&gt;</before>
1317
+ </examples>
1318
+ </method>
1319
+ <method cat='DOM/Manipulation' type='jQuery' short='Removes all matched elements from the DOM.' name='remove'>
1320
+ <desc>Removes all matched elements from the DOM. This does NOT remove them from the
1321
+ jQuery object, allowing you to use the matched elements further.
1322
+
1323
+ Can be filtered with an optional expressions.</desc>
1324
+ <params type='String' name='expr'>
1325
+ <desc>(optional) A jQuery expression to filter elements by.</desc>
1326
+ </params>
1327
+ <examples>
1328
+ <code>$("p").remove();</code>
1329
+ <result>how are</result>
1330
+ <before>&lt;p&gt;Hello&lt;/p&gt; how are &lt;p&gt;you?&lt;/p&gt;</before>
1331
+ </examples>
1332
+ <examples>
1333
+ <code>$("p").remove(".hello");</code>
1334
+ <result>how are &lt;p&gt;you?&lt;/p&gt;</result>
1335
+ <before>&lt;p class="hello"&gt;Hello&lt;/p&gt; how are &lt;p&gt;you?&lt;/p&gt;</before>
1336
+ </examples>
1337
+ </method>
1338
+ <method cat='DOM/Manipulation' type='jQuery' short='Removes all child nodes from the set of matched elements.' name='empty'>
1339
+ <desc>Removes all child nodes from the set of matched elements.</desc>
1340
+ <examples>
1341
+ <code>$("p").empty()</code>
1342
+ <result>[ &lt;p&gt;&lt;/p&gt; ]</result>
1343
+ <before>&lt;p&gt;Hello, &lt;span&gt;Person&lt;/span&gt; &lt;a href="#"&gt;and person&lt;/a&gt;&lt;/p&gt;</before>
1344
+ </examples>
1345
+ </method>
1346
+ <method cat='Core' type='jQuery' short='Reduce the set of matched elements to a single element.' name='eq'>
1347
+ <desc>Reduce the set of matched elements to a single element.
1348
+ The position of the element in the set of matched elements
1349
+ starts at 0 and goes to length - 1.</desc>
1350
+ <params type='Number' name='pos'>
1351
+ <desc>The index of the element that you wish to limit to.</desc>
1352
+ </params>
1353
+ <examples>
1354
+ <code>$("p").eq(1)</code>
1355
+ <result>[ &lt;p&gt;So is this&lt;/p&gt; ]</result>
1356
+ <before>&lt;p&gt;This is just a test.&lt;/p&gt;&lt;p&gt;So is this&lt;/p&gt;</before>
1357
+ </examples>
1358
+ </method>
1359
+ <method cat='Core' type='jQuery' short='Reduce the set of matched elements to all elements before a given position.' name='lt'>
1360
+ <desc>Reduce the set of matched elements to all elements before a given position.
1361
+ The position of the element in the set of matched elements
1362
+ starts at 0 and goes to length - 1.</desc>
1363
+ <params type='Number' name='pos'>
1364
+ <desc>Reduce the set to all elements below this position.</desc>
1365
+ </params>
1366
+ <examples>
1367
+ <code>$("p").lt(1)</code>
1368
+ <result>[ &lt;p&gt;This is just a test.&lt;/p&gt; ]</result>
1369
+ <before>&lt;p&gt;This is just a test.&lt;/p&gt;&lt;p&gt;So is this&lt;/p&gt;</before>
1370
+ </examples>
1371
+ </method>
1372
+ <method cat='Core' type='jQuery' short='Reduce the set of matched elements to all elements after a given position.' name='gt'>
1373
+ <desc>Reduce the set of matched elements to all elements after a given position.
1374
+ The position of the element in the set of matched elements
1375
+ starts at 0 and goes to length - 1.</desc>
1376
+ <params type='Number' name='pos'>
1377
+ <desc>Reduce the set to all elements after this position.</desc>
1378
+ </params>
1379
+ <examples>
1380
+ <code>$("p").gt(0)</code>
1381
+ <result>[ &lt;p&gt;So is this&lt;/p&gt; ]</result>
1382
+ <before>&lt;p&gt;This is just a test.&lt;/p&gt;&lt;p&gt;So is this&lt;/p&gt;</before>
1383
+ </examples>
1384
+ </method>
1385
+ <method cat='DOM/Traversing' type='jQuery' short='Filter the set of elements to those that contain the specified text.' name='contains'>
1386
+ <desc>Filter the set of elements to those that contain the specified text.</desc>
1387
+ <params type='String' name='str'>
1388
+ <desc>The string that will be contained within the text of an element.</desc>
1389
+ </params>
1390
+ <examples>
1391
+ <code>$("p").contains("test")</code>
1392
+ <result>[ &lt;p&gt;This is just a test.&lt;/p&gt; ]</result>
1393
+ <before>&lt;p&gt;This is just a test.&lt;/p&gt;&lt;p&gt;So is this&lt;/p&gt;</before>
1394
+ </examples>
1395
+ </method>
1396
+ <method cat='CSS' type='String' short='Get the current computed, pixel, width of the first matched element.' name='width'>
1397
+ <desc>Get the current computed, pixel, width of the first matched element.</desc>
1398
+ <examples>
1399
+ <code>$("p").width();</code>
1400
+ <result>300</result>
1401
+ <before>&lt;p&gt;This is just a test.&lt;/p&gt;</before>
1402
+ </examples>
1403
+ </method>
1404
+ <method cat='CSS' type='jQuery' short='Set the CSS width of every matched element.' name='width'>
1405
+ <desc>Set the CSS width of every matched element. If no explicit unit
1406
+ was specified (like 'em' or '%') then "px" is added to the width.</desc>
1407
+ <params type='String|Number' name='val'>
1408
+ <desc>Set the CSS property to the specified value.</desc>
1409
+ </params>
1410
+ <examples>
1411
+ <code>$("p").width(20);</code>
1412
+ <result>&lt;p style="width:20px;"&gt;This is just a test.&lt;/p&gt;</result>
1413
+ <before>&lt;p&gt;This is just a test.&lt;/p&gt;</before>
1414
+ </examples>
1415
+ <examples>
1416
+ <code>$("p").width("20em");</code>
1417
+ <result>&lt;p style="width:20em;"&gt;This is just a test.&lt;/p&gt;</result>
1418
+ <before>&lt;p&gt;This is just a test.&lt;/p&gt;</before>
1419
+ </examples>
1420
+ </method>
1421
+ <method cat='CSS' type='String' short='Get the current computed, pixel, height of the first matched element.' name='height'>
1422
+ <desc>Get the current computed, pixel, height of the first matched element.</desc>
1423
+ <examples>
1424
+ <code>$("p").height();</code>
1425
+ <result>300</result>
1426
+ <before>&lt;p&gt;This is just a test.&lt;/p&gt;</before>
1427
+ </examples>
1428
+ </method>
1429
+ <method cat='CSS' type='jQuery' short='Set the CSS height of every matched element.' name='height'>
1430
+ <desc>Set the CSS height of every matched element. If no explicit unit
1431
+ was specified (like 'em' or '%') then "px" is added to the width.</desc>
1432
+ <params type='String|Number' name='val'>
1433
+ <desc>Set the CSS property to the specified value.</desc>
1434
+ </params>
1435
+ <examples>
1436
+ <code>$("p").height(20);</code>
1437
+ <result>&lt;p style="height:20px;"&gt;This is just a test.&lt;/p&gt;</result>
1438
+ <before>&lt;p&gt;This is just a test.&lt;/p&gt;</before>
1439
+ </examples>
1440
+ <examples>
1441
+ <code>$("p").height("20em");</code>
1442
+ <result>&lt;p style="height:20em;"&gt;This is just a test.&lt;/p&gt;</result>
1443
+ <before>&lt;p&gt;This is just a test.&lt;/p&gt;</before>
1444
+ </examples>
1445
+ </method>
1446
+ <method cat='Core' type='Array&lt;Element&gt;' short='' private='1' name='$.find'>
1447
+ <desc></desc>
1448
+ </method>
1449
+ <method cat='DOM/Traversing' type='Array&lt;Element&gt;' short='All ancestors of a given element.' name='$.parents' private='1'>
1450
+ <desc>All ancestors of a given element.</desc>
1451
+ <params type='Element' name='elem'>
1452
+ <desc>The element to find the ancestors of.</desc>
1453
+ </params>
1454
+ </method>
1455
+ <method cat='DOM/Traversing' type='DOMElement' short='A handy, and fast, way to traverse in a particular direction and find
1456
+ a specific element.' name='$.nth' private='1'>
1457
+ <desc>A handy, and fast, way to traverse in a particular direction and find
1458
+ a specific element.</desc>
1459
+ <params type='DOMElement' name='cur'>
1460
+ <desc>The element to search from.</desc>
1461
+ </params>
1462
+ <params type='String|Number' name='num'>
1463
+ <desc>The Nth result to match. Can be a number or a string (like 'even' or 'odd').</desc>
1464
+ </params>
1465
+ <params type='String' name='dir'>
1466
+ <desc>The direction to move in (pass in something like 'previousSibling' or 'nextSibling').</desc>
1467
+ </params>
1468
+ </method>
1469
+ <method cat='DOM/Traversing' type='Array' short='All elements on a specified axis.' name='$.sibling' private='1'>
1470
+ <desc>All elements on a specified axis.</desc>
1471
+ <params type='Element' name='elem'>
1472
+ <desc>The element to find all the siblings of (including itself).</desc>
1473
+ </params>
1474
+ </method>
1475
+ <method cat='Events' type='jQuery' short='Binds a handler to a particular event (like click) for each matched element.' name='bind'>
1476
+ <desc>Binds a handler to a particular event (like click) for each matched element.
1477
+ The event handler is passed an event object that you can use to prevent
1478
+ default behaviour. To stop both default action and event bubbling, your handler
1479
+ has to return false.
1480
+
1481
+ In most cases, you can define your event handlers as anonymous functions
1482
+ (see first example). In cases where that is not possible, you can pass additional
1483
+ data as the second parameter (and the handler function as the third), see
1484
+ second example.</desc>
1485
+ <params type='String' name='type'>
1486
+ <desc>An event type</desc>
1487
+ </params>
1488
+ <params type='Object' name='data'>
1489
+ <desc>(optional) Additional data passed to the event handler as event.data</desc>
1490
+ </params>
1491
+ <params type='Function' name='fn'>
1492
+ <desc>A function to bind to the event on each of the set of matched elements</desc>
1493
+ </params>
1494
+ <examples>
1495
+ <code>$("p").bind("click", function(){
1496
+ alert( $(this).text() );
1497
+ });</code>
1498
+ <result>alert("Hello")</result>
1499
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1500
+ </examples>
1501
+ <examples>
1502
+ <desc>Pass some additional data to the event handler.</desc>
1503
+ <code>function handler(event) {
1504
+ alert(event.data.foo);
1505
+ }
1506
+ $("p").bind("click", {foo: "bar"}, handler)</code>
1507
+ <result>alert("bar")</result>
1508
+ </examples>
1509
+ <examples>
1510
+ <desc>Cancel a default action and prevent it from bubbling by returning false
1511
+ from your function.</desc>
1512
+ <code>$("form").bind("submit", function() { return false; })</code>
1513
+ </examples>
1514
+ <examples>
1515
+ <desc>Cancel only the default action by using the preventDefault method.</desc>
1516
+ <code>$("form").bind("submit", function(event){
1517
+ event.preventDefault();
1518
+ });</code>
1519
+ </examples>
1520
+ <examples>
1521
+ <desc>Stop only an event from bubbling by using the stopPropagation method.</desc>
1522
+ <code>$("form").bind("submit", function(event){
1523
+ event.stopPropagation();
1524
+ });</code>
1525
+ </examples>
1526
+ </method>
1527
+ <method cat='Events' type='jQuery' short='Binds a handler to a particular event (like click) for each matched element.' name='one'>
1528
+ <desc>Binds a handler to a particular event (like click) for each matched element.
1529
+ The handler is executed only once for each element. Otherwise, the same rules
1530
+ as described in bind() apply.
1531
+ The event handler is passed an event object that you can use to prevent
1532
+ default behaviour. To stop both default action and event bubbling, your handler
1533
+ has to return false.
1534
+
1535
+ In most cases, you can define your event handlers as anonymous functions
1536
+ (see first example). In cases where that is not possible, you can pass additional
1537
+ data as the second paramter (and the handler function as the third), see
1538
+ second example.</desc>
1539
+ <params type='String' name='type'>
1540
+ <desc>An event type</desc>
1541
+ </params>
1542
+ <params type='Object' name='data'>
1543
+ <desc>(optional) Additional data passed to the event handler as event.data</desc>
1544
+ </params>
1545
+ <params type='Function' name='fn'>
1546
+ <desc>A function to bind to the event on each of the set of matched elements</desc>
1547
+ </params>
1548
+ <examples>
1549
+ <code>$("p").one("click", function(){
1550
+ alert( $(this).text() );
1551
+ });</code>
1552
+ <result>alert("Hello")</result>
1553
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1554
+ </examples>
1555
+ </method>
1556
+ <method cat='Events' type='jQuery' short='The opposite of bind, removes a bound event from each of the matched
1557
+ elements.' name='unbind'>
1558
+ <desc>The opposite of bind, removes a bound event from each of the matched
1559
+ elements.
1560
+
1561
+ Without any arguments, all bound events are removed.
1562
+
1563
+ If the type is provided, all bound events of that type are removed.
1564
+
1565
+ If the function that was passed to bind is provided as the second argument,
1566
+ only that specific event handler is removed.</desc>
1567
+ <params type='String' name='type'>
1568
+ <desc>(optional) An event type</desc>
1569
+ </params>
1570
+ <params type='Function' name='fn'>
1571
+ <desc>(optional) A function to unbind from the event on each of the set of matched elements</desc>
1572
+ </params>
1573
+ <examples>
1574
+ <code>$("p").unbind()</code>
1575
+ <result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
1576
+ <before>&lt;p onclick="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
1577
+ </examples>
1578
+ <examples>
1579
+ <code>$("p").unbind( "click" )</code>
1580
+ <result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
1581
+ <before>&lt;p onclick="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
1582
+ </examples>
1583
+ <examples>
1584
+ <code>$("p").unbind( "click", function() { alert("Hello"); } )</code>
1585
+ <result>[ &lt;p&gt;Hello&lt;/p&gt; ]</result>
1586
+ <before>&lt;p onclick="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
1587
+ </examples>
1588
+ </method>
1589
+ <method cat='Events' type='jQuery' short='Trigger a type of event on every matched element.' name='trigger'>
1590
+ <desc>Trigger a type of event on every matched element. This will also cause
1591
+ the default action of the browser with the same name (if one exists)
1592
+ to be executed. For example, passing 'submit' to the trigger()
1593
+ function will also cause the browser to submit the form. This
1594
+ default action can be prevented by returning false from one of
1595
+ the functions bound to the event.
1596
+
1597
+ You can also trigger custom events registered with bind.</desc>
1598
+ <params type='String' name='type'>
1599
+ <desc>An event type to trigger.</desc>
1600
+ </params>
1601
+ <params type='Array' name='data'>
1602
+ <desc>(optional) Additional data to pass as arguments (after the event object) to the event handler</desc>
1603
+ </params>
1604
+ <examples>
1605
+ <code>$("p").trigger("click")</code>
1606
+ <result>alert('hello')</result>
1607
+ <before>&lt;p click="alert('hello')"&gt;Hello&lt;/p&gt;</before>
1608
+ </examples>
1609
+ <examples>
1610
+ <desc>Example of how to pass arbitrary data to an event</desc>
1611
+ <code>$("p").click(function(event, a, b) {
1612
+ // when a normal click fires, a and b are undefined
1613
+ // for a trigger like below a refers too "foo" and b refers to "bar"
1614
+ }).trigger("click", ["foo", "bar"]);</code>
1615
+ </examples>
1616
+ <examples>
1617
+ <code>$("p").bind("myEvent",function(event,message1,message2) {
1618
+ alert(message1 + ' ' + message2);
1619
+ });
1620
+ $("p").trigger("myEvent",["Hello","World"]);</code>
1621
+ <result>alert('Hello World') // One for each paragraph</result>
1622
+ </examples>
1623
+ </method>
1624
+ <method cat='Events' type='jQuery' short='Toggle between two function calls every other click.' name='toggle'>
1625
+ <desc>Toggle between two function calls every other click.
1626
+ Whenever a matched element is clicked, the first specified function
1627
+ is fired, when clicked again, the second is fired. All subsequent
1628
+ clicks continue to rotate through the two functions.
1629
+
1630
+ Use unbind("click") to remove.</desc>
1631
+ <params type='Function' name='even'>
1632
+ <desc>The function to execute on every even click.</desc>
1633
+ </params>
1634
+ <params type='Function' name='odd'>
1635
+ <desc>The function to execute on every odd click.</desc>
1636
+ </params>
1637
+ <examples>
1638
+ <code>$("p").toggle(function(){
1639
+ $(this).addClass("selected");
1640
+ },function(){
1641
+ $(this).removeClass("selected");
1642
+ });</code>
1643
+ </examples>
1644
+ </method>
1645
+ <method cat='Events' type='jQuery' short='A method for simulating hovering (moving the mouse on, and off,
1646
+ an object).' name='hover'>
1647
+ <desc>A method for simulating hovering (moving the mouse on, and off,
1648
+ an object). This is a custom method which provides an 'in' to a
1649
+ frequent task.
1650
+
1651
+ Whenever the mouse cursor is moved over a matched
1652
+ element, the first specified function is fired. Whenever the mouse
1653
+ moves off of the element, the second specified function fires.
1654
+ Additionally, checks are in place to see if the mouse is still within
1655
+ the specified element itself (for example, an image inside of a div),
1656
+ and if it is, it will continue to 'hover', and not move out
1657
+ (a common error in using a mouseout event handler).</desc>
1658
+ <params type='Function' name='over'>
1659
+ <desc>The function to fire whenever the mouse is moved over a matched element.</desc>
1660
+ </params>
1661
+ <params type='Function' name='out'>
1662
+ <desc>The function to fire whenever the mouse is moved off of a matched element.</desc>
1663
+ </params>
1664
+ <examples>
1665
+ <code>$("p").hover(function(){
1666
+ $(this).addClass("hover");
1667
+ },function(){
1668
+ $(this).removeClass("hover");
1669
+ });</code>
1670
+ </examples>
1671
+ </method>
1672
+ <method cat='Events' type='jQuery' short='Bind a function to be executed whenever the DOM is ready to be
1673
+ traversed and manipulated.' name='ready'>
1674
+ <desc>Bind a function to be executed whenever the DOM is ready to be
1675
+ traversed and manipulated. This is probably the most important
1676
+ function included in the event module, as it can greatly improve
1677
+ the response times of your web applications.
1678
+
1679
+ In a nutshell, this is a solid replacement for using window.onload,
1680
+ and attaching a function to that. By using this method, your bound function
1681
+ will be called the instant the DOM is ready to be read and manipulated,
1682
+ which is when what 99.99% of all JavaScript code needs to run.
1683
+
1684
+ There is one argument passed to the ready event handler: A reference to
1685
+ the jQuery function. You can name that argument whatever you like, and
1686
+ can therefore stick with the $ alias without risk of naming collisions.
1687
+
1688
+ Please ensure you have no code in your &lt;body&gt; onload event handler,
1689
+ otherwise $(document).ready() may not fire.
1690
+
1691
+ You can have as many $(document).ready events on your page as you like.
1692
+ The functions are then executed in the order they were added.</desc>
1693
+ <see>$.noConflict()</see>
1694
+ <see>$(Function)</see>
1695
+ <params type='Function' name='fn'>
1696
+ <desc>The function to be executed when the DOM is ready.</desc>
1697
+ </params>
1698
+ <examples>
1699
+ <code>$(document).ready(function(){ Your code here... });</code>
1700
+ </examples>
1701
+ <examples>
1702
+ <desc>Uses both the [[Core#.24.28_fn_.29|shortcut]] for $(document).ready() and the argument
1703
+ to write failsafe jQuery code using the $ alias, without relying on the
1704
+ global alias.</desc>
1705
+ <code>jQuery(function($) {
1706
+ // Your code using failsafe $ alias here...
1707
+ });</code>
1708
+ </examples>
1709
+ </method>
1710
+ <method cat='Events' type='jQuery' short='Bind a function to the scroll event of each matched element.' name='scroll'>
1711
+ <desc>Bind a function to the scroll event of each matched element.</desc>
1712
+ <params type='Function' name='fn'>
1713
+ <desc>A function to bind to the scroll event on each of the matched elements.</desc>
1714
+ </params>
1715
+ <examples>
1716
+ <code>$("p").scroll( function() { alert("Hello"); } );</code>
1717
+ <result>&lt;p onscroll="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1718
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1719
+ </examples>
1720
+ </method>
1721
+ <method cat='Events' type='jQuery' short='Bind a function to the submit event of each matched element.' name='submit'>
1722
+ <desc>Bind a function to the submit event of each matched element.</desc>
1723
+ <params type='Function' name='fn'>
1724
+ <desc>A function to bind to the submit event on each of the matched elements.</desc>
1725
+ </params>
1726
+ <examples>
1727
+ <desc>Prevents the form submission when the input has no value entered.</desc>
1728
+ <code>$("#myform").submit( function() {
1729
+ return $("input", this).val().length &gt; 0;
1730
+ } );</code>
1731
+ <before>&lt;form id="myform"&gt;&lt;input /&gt;&lt;/form&gt;</before>
1732
+ </examples>
1733
+ </method>
1734
+ <method cat='Events' type='jQuery' short='Trigger the submit event of each matched element.' name='submit'>
1735
+ <desc>Trigger the submit event of each matched element. This causes all of the functions
1736
+ that have been bound to that submit event to be executed, and calls the browser's
1737
+ default submit action on the matching element(s). This default action can be prevented
1738
+ by returning false from one of the functions bound to the submit event.
1739
+
1740
+ Note: This does not execute the submit method of the form element! If you need to
1741
+ submit the form via code, you have to use the DOM method, eg. $("form")[0].submit();</desc>
1742
+ <examples>
1743
+ <desc>Triggers all submit events registered to the matched form(s), and submits them.</desc>
1744
+ <code>$("form").submit();</code>
1745
+ </examples>
1746
+ </method>
1747
+ <method cat='Events' type='jQuery' short='Bind a function to the focus event of each matched element.' name='focus'>
1748
+ <desc>Bind a function to the focus event of each matched element.</desc>
1749
+ <params type='Function' name='fn'>
1750
+ <desc>A function to bind to the focus event on each of the matched elements.</desc>
1751
+ </params>
1752
+ <examples>
1753
+ <code>$("p").focus( function() { alert("Hello"); } );</code>
1754
+ <result>&lt;p onfocus="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1755
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1756
+ </examples>
1757
+ </method>
1758
+ <method cat='Events' type='jQuery' short='Trigger the focus event of each matched element.' name='focus'>
1759
+ <desc>Trigger the focus event of each matched element. This causes all of the functions
1760
+ that have been bound to thet focus event to be executed.
1761
+
1762
+ Note: This does not execute the focus method of the underlying elements! If you need to
1763
+ focus an element via code, you have to use the DOM method, eg. $("#myinput")[0].focus();</desc>
1764
+ <examples>
1765
+ <code>$("p").focus();</code>
1766
+ <result>alert('Hello');</result>
1767
+ <before>&lt;p onfocus="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
1768
+ </examples>
1769
+ </method>
1770
+ <method cat='Events' type='jQuery' short='Bind a function to the keydown event of each matched element.' name='keydown'>
1771
+ <desc>Bind a function to the keydown event of each matched element.</desc>
1772
+ <params type='Function' name='fn'>
1773
+ <desc>A function to bind to the keydown event on each of the matched elements.</desc>
1774
+ </params>
1775
+ <examples>
1776
+ <code>$("p").keydown( function() { alert("Hello"); } );</code>
1777
+ <result>&lt;p onkeydown="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1778
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1779
+ </examples>
1780
+ </method>
1781
+ <method cat='Events' type='jQuery' short='Bind a function to the dblclick event of each matched element.' name='dblclick'>
1782
+ <desc>Bind a function to the dblclick event of each matched element.</desc>
1783
+ <params type='Function' name='fn'>
1784
+ <desc>A function to bind to the dblclick event on each of the matched elements.</desc>
1785
+ </params>
1786
+ <examples>
1787
+ <code>$("p").dblclick( function() { alert("Hello"); } );</code>
1788
+ <result>&lt;p ondblclick="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1789
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1790
+ </examples>
1791
+ </method>
1792
+ <method cat='Events' type='jQuery' short='Bind a function to the keypress event of each matched element.' name='keypress'>
1793
+ <desc>Bind a function to the keypress event of each matched element.</desc>
1794
+ <params type='Function' name='fn'>
1795
+ <desc>A function to bind to the keypress event on each of the matched elements.</desc>
1796
+ </params>
1797
+ <examples>
1798
+ <code>$("p").keypress( function() { alert("Hello"); } );</code>
1799
+ <result>&lt;p onkeypress="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1800
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1801
+ </examples>
1802
+ </method>
1803
+ <method cat='Events' type='jQuery' short='Bind a function to the error event of each matched element.' name='error'>
1804
+ <desc>Bind a function to the error event of each matched element.</desc>
1805
+ <params type='Function' name='fn'>
1806
+ <desc>A function to bind to the error event on each of the matched elements.</desc>
1807
+ </params>
1808
+ <examples>
1809
+ <code>$("p").error( function() { alert("Hello"); } );</code>
1810
+ <result>&lt;p onerror="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1811
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1812
+ </examples>
1813
+ </method>
1814
+ <method cat='Events' type='jQuery' short='Bind a function to the blur event of each matched element.' name='blur'>
1815
+ <desc>Bind a function to the blur event of each matched element.</desc>
1816
+ <params type='Function' name='fn'>
1817
+ <desc>A function to bind to the blur event on each of the matched elements.</desc>
1818
+ </params>
1819
+ <examples>
1820
+ <code>$("p").blur( function() { alert("Hello"); } );</code>
1821
+ <result>&lt;p onblur="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1822
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1823
+ </examples>
1824
+ </method>
1825
+ <method cat='Events' type='jQuery' short='Trigger the blur event of each matched element.' name='blur'>
1826
+ <desc>Trigger the blur event of each matched element. This causes all of the functions
1827
+ that have been bound to that blur event to be executed, and calls the browser's
1828
+ default blur action on the matching element(s). This default action can be prevented
1829
+ by returning false from one of the functions bound to the blur event.
1830
+
1831
+ Note: This does not execute the blur method of the underlying elements! If you need to
1832
+ blur an element via code, you have to use the DOM method, eg. $("#myinput")[0].blur();</desc>
1833
+ <examples>
1834
+ <code>$("p").blur();</code>
1835
+ <result>alert('Hello');</result>
1836
+ <before>&lt;p onblur="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
1837
+ </examples>
1838
+ </method>
1839
+ <method cat='Events' type='jQuery' short='Bind a function to the load event of each matched element.' name='load'>
1840
+ <desc>Bind a function to the load event of each matched element.</desc>
1841
+ <params type='Function' name='fn'>
1842
+ <desc>A function to bind to the load event on each of the matched elements.</desc>
1843
+ </params>
1844
+ <examples>
1845
+ <code>$("p").load( function() { alert("Hello"); } );</code>
1846
+ <result>&lt;p onload="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1847
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1848
+ </examples>
1849
+ </method>
1850
+ <method cat='Events' type='jQuery' short='Bind a function to the select event of each matched element.' name='select'>
1851
+ <desc>Bind a function to the select event of each matched element.</desc>
1852
+ <params type='Function' name='fn'>
1853
+ <desc>A function to bind to the select event on each of the matched elements.</desc>
1854
+ </params>
1855
+ <examples>
1856
+ <code>$("p").select( function() { alert("Hello"); } );</code>
1857
+ <result>&lt;p onselect="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1858
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1859
+ </examples>
1860
+ </method>
1861
+ <method cat='Events' type='jQuery' short='Trigger the select event of each matched element.' name='select'>
1862
+ <desc>Trigger the select event of each matched element. This causes all of the functions
1863
+ that have been bound to that select event to be executed, and calls the browser's
1864
+ default select action on the matching element(s). This default action can be prevented
1865
+ by returning false from one of the functions bound to the select event.</desc>
1866
+ <examples>
1867
+ <code>$("p").select();</code>
1868
+ <result>alert('Hello');</result>
1869
+ <before>&lt;p onselect="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
1870
+ </examples>
1871
+ </method>
1872
+ <method cat='Events' type='jQuery' short='Bind a function to the mouseup event of each matched element.' name='mouseup'>
1873
+ <desc>Bind a function to the mouseup event of each matched element.</desc>
1874
+ <params type='Function' name='fn'>
1875
+ <desc>A function to bind to the mouseup event on each of the matched elements.</desc>
1876
+ </params>
1877
+ <examples>
1878
+ <code>$("p").mouseup( function() { alert("Hello"); } );</code>
1879
+ <result>&lt;p onmouseup="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1880
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1881
+ </examples>
1882
+ </method>
1883
+ <method cat='Events' type='jQuery' short='Bind a function to the unload event of each matched element.' name='unload'>
1884
+ <desc>Bind a function to the unload event of each matched element.</desc>
1885
+ <params type='Function' name='fn'>
1886
+ <desc>A function to bind to the unload event on each of the matched elements.</desc>
1887
+ </params>
1888
+ <examples>
1889
+ <code>$("p").unload( function() { alert("Hello"); } );</code>
1890
+ <result>&lt;p onunload="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1891
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1892
+ </examples>
1893
+ </method>
1894
+ <method cat='Events' type='jQuery' short='Bind a function to the change event of each matched element.' name='change'>
1895
+ <desc>Bind a function to the change event of each matched element.</desc>
1896
+ <params type='Function' name='fn'>
1897
+ <desc>A function to bind to the change event on each of the matched elements.</desc>
1898
+ </params>
1899
+ <examples>
1900
+ <code>$("p").change( function() { alert("Hello"); } );</code>
1901
+ <result>&lt;p onchange="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1902
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1903
+ </examples>
1904
+ </method>
1905
+ <method cat='Events' type='jQuery' short='Bind a function to the mouseout event of each matched element.' name='mouseout'>
1906
+ <desc>Bind a function to the mouseout event of each matched element.</desc>
1907
+ <params type='Function' name='fn'>
1908
+ <desc>A function to bind to the mouseout event on each of the matched elements.</desc>
1909
+ </params>
1910
+ <examples>
1911
+ <code>$("p").mouseout( function() { alert("Hello"); } );</code>
1912
+ <result>&lt;p onmouseout="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1913
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1914
+ </examples>
1915
+ </method>
1916
+ <method cat='Events' type='jQuery' short='Bind a function to the keyup event of each matched element.' name='keyup'>
1917
+ <desc>Bind a function to the keyup event of each matched element.</desc>
1918
+ <params type='Function' name='fn'>
1919
+ <desc>A function to bind to the keyup event on each of the matched elements.</desc>
1920
+ </params>
1921
+ <examples>
1922
+ <code>$("p").keyup( function() { alert("Hello"); } );</code>
1923
+ <result>&lt;p onkeyup="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1924
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1925
+ </examples>
1926
+ </method>
1927
+ <method cat='Events' type='jQuery' short='Bind a function to the click event of each matched element.' name='click'>
1928
+ <desc>Bind a function to the click event of each matched element.</desc>
1929
+ <params type='Function' name='fn'>
1930
+ <desc>A function to bind to the click event on each of the matched elements.</desc>
1931
+ </params>
1932
+ <examples>
1933
+ <code>$("p").click( function() { alert("Hello"); } );</code>
1934
+ <result>&lt;p onclick="alert('Hello');"&gt;Hello&lt;/p&gt;</result>
1935
+ <before>&lt;p&gt;Hello&lt;/p&gt;</before>
1936
+ </examples>
1937
+ </method>
1938
+ <method cat='Events' type='jQuery' short='Trigger the click event of each matched element.' name='click'>
1939
+ <desc>Trigger the click event of each matched element. This causes all of the functions
1940
+ that have been bound to thet click event to be executed.</desc>
1941
+ <examples>
1942
+ <code>$("p").click();</code>
1943
+ <result>alert('Hello');</result>
1944
+ <before>&lt;p onclick="alert('Hello');"&gt;Hello&lt;/p&gt;</before>
1945
+ </examples>
1946
+ </method>
1947
+ <method cat='Events' type='jQuery' short='Bind a function to the resize event of each matched element.' name='resize'>
1948
+ <desc>Bind a function to the resize event of each matched element.</desc>
1949
+ <params type='Function' name='fn'>
1950
+ <desc>A function to bind to the resize event on each of the matched elements.</desc>
1951
+ </params>
1952