CodeToFun
Learn Programming Free
Tutorials
Languages
Features
About
Sign In
Tutorials
Languages
Features
About
Sign In
Back
/
JavaScript Alphabet Pattern 15
JavaScript Alphabet Pattern 15 (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 15 - Try It (Browser)</title> <style> div.cell { display: inline-block; text-align: center; width: 13px; } </style> </head> <body> <h1>Mirror bowtie (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\">" + String.fromCharCode(j) + "</div>"); } for (let k = i; k < top; k++) { document.write("<div class=\"cell\">*</div><div class=\"cell\">*</div>"); } for (let m = i; m >= A; m--) { document.write("<div class=\"cell\">" + String.fromCharCode(m) + "</div>"); } document.write("<br>"); } </script> </body> </html>
Lines:
0
| Characters:
0
Live Preview
Auto-refresh on Run