Example #6: iterate all selected elements with a timeout

Here we combine two loops. The outer loop is an open interval loop repeating once per second. The inner loop is a sequential each-loop toggling the CSS class for every selected span element with a timeout after each step.

$('.example span').repeat(1000)
  .each($).toggleClass('bold').wait(50);

This is a sample sentence with some words.

Other examples with each-loops

Other examples with instant loops

Other examples with intervals

Other examples with open loops

Other examples with repeat-loops

Other examples with timeouts