debugger Statement - Javascript Statement

Javascript examples for Statement:debugger

Description

The debugger statement stops the execution of JavaScript, and calls (if available) the debugging function.

With the debugger turned on, this code should stop executing before it executes the third line:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
</head>//from ww w.j a v  a2 s .c  o  m
<body>

<p id="demo"></p>

<script>
var x = 15 * 5;
debugger;
document.getElementById("demo").innerHTML = x;
</script>

</body>
</html>

Related Tutorials