Hi,
Assuming this is a generic banner ad, you can try to remove the <gwd-generic> element from the document to 'close' the ad.
Eg:
function closeAd() {
var element = document.getElementById('gwd-ad'); // this should return the <gwd-genericad> element
element.parentNode.removeChild(element);
}
Alternatively, if your Ad is running inside an iframe, you can also clear the document body.
function closeAd() {
document.body.innerHTML = '';
}
document.getElementById('btn-close').addEventListener('click', closeAd);
Let us know if either of this works.
Kishore