Tutorials

Learn web design and programming with our free video and text tutorials.

Web Designer? Design and market your own professional website with easy-to-use tools.

Javascript continue Loop Tutorial

Javascript allows you to use the keyword "continue" to break the current loop and continue with the next value.

The javascript below shows you how to use the continue keyword in action.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>WebDevelopmentTutorials.com</title>

</head>
<body>

<script type="text/javascript" language="javascript">

var i=0
for (i=0;i<=10;i++)
{
if (i==1)
{
continue;
}
document.write("The number is " + i + "<br />");
}

</script>

</body>
</html>

The javascript code above displays: