2.3.1.33 loop

loop of type long

Note: EdgeHTML Mode does not provide the loop attribute for the HTMLImageElement or HTMLInputElement interfaces.

Sets or retrieves the number of times a marquee, sound, or video clip will loop.

When defining the marquee element, possible values are:

  • 0, -1 - Loops infinitely. The default value is -1.

  • count - Number of times to loop

In each of the following boundary cases, the marquee loops infinitely:

  • <MARQUEE SCROLLAMOUNT=30 LOOP>This is some scrolling text.</MARQUEE>

  • <MARQUEE SCROLLAMOUNT=30 LOOP=0>This is some scrolling text.</MARQUEE>

  • <MARQUEE SCROLLAMOUNT=30 LOOP=>This is some scrolling text.</MARQUEE> 

If you set the loop property to null or 0 in script, a scripting error occurs.

When defining the image or input elements, possible values are:

  • 0, -1 - Loops infinitely. The default value is 1.

  • count - Number of times to loop

To restart a sound or video clip after changing its loop property, set the src property or dynsrc property to itself.

This attribute extends the following interfaces:

All Document Modes (All Versions)

Quirks Mode, IE7 Mode, IE8 Mode, IE9 Mode, IE10 Mode, and IE11 Mode (All Versions)

  • HTMLImageElement

  • HTMLInputElement