- … – miscellaneous parameters
- any parameter accepted by the jQuery function itself.
Tip: With .$(…) you can switch the jQuery selection within any invocation chain.
See jQuery API for
Examples with crate a jQuery selection
By using .toggleClass() the CSS class switches from being added and removed after every interval timeout.
In this example the interval timeout is set to 400 milliseconds.⇒
See also another example for the same task using iterated timeouts instead.
The handler-less version of .on() allows to create small event handlers very easily. In this example the span element is shifted right with each button click.⇒
Imagine you want to add very many table rows automatically so you can fill them with dynamic content.
E.g. a 30 x 200 sized table. Then you need only one callback method creating each cell. The rest is done via a single jQuery chain:
With the concatenation of two .wait()s we achieve a single short blink.
Instead of attaching an event handler explicitly we start an infinite event loop for the "click" event. Repeat loops are always sequential, i.e. the next iteration can start only if the previous one ended. You can see this behavior when double- or triple-clicking the button.⇒