Example #4: blinking a given number of times on click

We repeat .toggleClass() for an even number of times, so the class "blink" is absent again when the repeat loop finishes.

Remark that the click handler is assigned directly in the invocation chain using .click($).

$('.example button').click($).siblings('span')
   .repeat(200).toggleClass('blink').until(4);

Other examples with closed loops

Other examples with inline attached events

Other examples with instant loops

Other examples with repeat-loops