我创建了免费托管网站,并且在加载时不断弹出网站广告。我想要的是删除包含广告的特定行。我想删除**** BOLD ****行,因为它们每次都是相同的。
<head></head>
<body class="twoColFixRtHdr">
<map name="map1"></map>
<script type="text/javascript"></script>
<div id="container"></div>
**<div class="bModal __bPopup1" style="background-color: rgb(0, 0, 0); height: 100%; left: 0px; opa…ixed; top: 0px; width: 100%; z-index: 9998; cursor: pointer;"></div>
<div id="visas_style_div" class="popup" style="left: 627px; position: absolute; top: 20px; z-index: 9999;"></div>**
</body>
答案 0 :(得分:1)
您可以使用document.getElementsByClassName:
<script type="text/javascript">
function hidepopup() {
var divpopup = document.getElementsByClassName('bModal __bPopup1');
if(divpopup.length > 0)
divpopup[0].style.display = 'none';
}
window.onload = hidepopup;
</script>