Description: Create a new jQuery selection object due to given parameters.

… – 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

Example #1: repeated blinking (like in the old days with the deprecated <blink> element)

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.


This is a blinking text.

See also another example for the same task using iterated timeouts instead.

Example #3: a simple inline click handler

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.


Watch me moving!

Example #5: create dynamic tables with instant loops

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:

function createCell(x,y) {

My dynamic data:

Example #14: wait a timeout after each click before blinking

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.

$('.example button').repeat('click').prev()

That text blinks half a second after hitting .