CodeToFun
Learn Programming Free
Tutorials
Languages
Features
About
Sign In
Tutorials
Languages
Features
About
Sign In
Back
/
JavaScript Alphabet Pattern 23
JavaScript Alphabet Pattern 23 (Try It — Browser)
Try It
Run
Reset
Save
Save to Google Drive
Sync with your Google account
Download HTML
Save to your device
Share
Full
HTML Code
Copy
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>JS Alphabet Pattern 23 - Try It (Browser)</title> <style> div.cell { display: inline-block; text-align: center; width: 18px; } </style> </head> <body> <h1>Reverse pyramid (document.write)</h1> <p>Edit the loops, then click Run.</p> <script> const A = 65; const top = 69; for (let i = top; i >= A; i--) { for (let j = A; j < i; j++) document.write("<div class=\"cell\"></div>"); for (let j = top; j >= i; j--) document.write("<div class=\"cell\">" + String.fromCharCode(j) + "</div>"); document.write("<br>"); } </script> </body> </html>
Lines:
0
| Characters:
0
Live Preview
Auto-refresh on Run