top of page
bottom of page
// Create a new div element const messageDiv = document.createElement('div'); // Set the text content of the div messageDiv.textContent = 'Hello from JavaScript!'; // Style the div for visibility messageDiv.style.position = 'fixed'; messageDiv.style.bottom = '10px'; messageDiv.style.right = '10px'; messageDiv.style.backgroundColor = 'rgba(0, 0, 0, 0.8)'; messageDiv.style.color = 'white'; messageDiv.style.padding = '10px'; messageDiv.style.borderRadius = '5px'; messageDiv.style.fontFamily = 'Arial, sans-serif'; messageDiv.style.zIndex = '9999'; // Append the div to the body document.body.appendChild(messageDiv);