screen_rotation
Copied to Clipboard
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Current Domain Example</title> </head> <body> <h1>Javascript get current domain name</h1> <!-- Display the current domain on the webpage --> <p id="domain-display"></p> <script> var currentDomain = window.location.hostname; var domainDisplay = document.getElementById('domain-display'); domainDisplay.textContent = "Current Domain: " + currentDomain; </script> </body> </html>