Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

İlyas Özkurt ilyasozkurt

💭
I may be slow to respond.
View GitHub Profile
@sureshHARDIYA
sureshHARDIYA / adsense.js
Last active Oct 5, 2022
Create Google Adsense ad using JavaScript
View adsense.js
var adUnit = document.getElementsByClassName("section-below-title")[0];
var parentElement = adUnit.childNodes[0];
// Create script element
var script = document.createElement('script');
script.async = true;
script.src = "https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js";
parentElement.appendChild(script);
// Create INS element