Web.QHMIT
.com
Toggle navigation
☰
Home
HTML
CSS
Scripting
Database
Run
<!DOCTYPE html> <title>My Example</title> <p id="msg"></p> <script> // Set variables var output = ""; // Outer loop for (i = 1; i <= 10; i++) { output += "<h1>" + i + " times table</h1>"; output += "<ul>"; // Inner loop for (j = 1; j <= 10; j++) { output += "<li>" + j + " x " + i + " = " + j * i; } output += "</ul>"; } // Output results to the above HTML element document.getElementById("msg").innerHTML = output; </script>
Preview