// Create a banner ad dynamically in JavaScript
const createBannerAd = () => {
// Create a container div for the ad
const bannerDiv = document.createElement('div');
bannerDiv.style.width = '460px';
bannerDiv.style.height = '60px';
bannerDiv.style.backgroundColor = '#f4f4f4';
bannerDiv.style.border = '1px solid #ccc';
bannerDiv.style.display = 'flex';
bannerDiv.style.alignItems = 'center';
bannerDiv.style.justifyContent = 'center';
bannerDiv.style.fontFamily = 'Arial, sans-serif';
bannerDiv.style.cursor = 'pointer';
// Add event listener to navigate to the website on click
bannerDiv.addEventListener('click', () => {
window.open('https://ghglitch.blogspot.com/', '_blank');
});
// Add text or logo inside the banner
const bannerText = document.createElement('span');
bannerText.textContent = 'Visit GH Glitch Blog!';
bannerText.style.color = '#333';
bannerText.style.fontSize = '16px';
bannerText.style.fontWeight = 'bold';
// Append the text to the banner
bannerDiv.appendChild(bannerText);
// Append the banner to the body or any container
document.body.appendChild(bannerDiv);
};
// Call the function to create and display the banner ad
createBannerAd();
Latest Apps and Games






