I need to find and remove this paticular tag from my html page :
<div style="margin-top: 15px;">Access Denied</div>
How do I accomplish this? I have seen the following
But I still can't understand how to find and remove an exact tag that matches this string from the current whole html document.
Any way to do this?
Thanks.
Edit : I only have access to modify the contents of :`
<div style="height: 200px;width: 500px; overflow: auto;" id="message">
` Here's the whole html document when the page is loaded :
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Access Denied</title>
<style type="text/css">.accessdeniedtextfont{FONT-WEIGHT: bolder;FONT-SIZE: 12px;COLOR: #565656;FONT-FAMILY: arial,san-serif;TEXT-DECORATION: none}.accessdeniedcategoryfont{font-weight:bold; FONT-SIZE: 12px;COLOR: #336699;FONT-FAMILY: verdana,arial,san-serif;TEXT-DECORATION: none}</style>
<meta http-equiv="Content-Language" content="en-us">
<script src="/javascript/validation/DefaultDeniedMessagePreview.js" type="text/javascript"/>
</head>
<body style="background: #FFFFFF;font-family: Arial;font-size: 12px;font-weight: bold;color: #565656;">
<form name="previewform">
<table width="100%">
<tbody>
<tr>
<td align="center">
<div style="background: #FFFFFF;margin-top: 9%;box-shadow: 0px 0px 10px #666666;border: 1px solid #CCCCCC;width: 600px;;height:auto">
<table width="100%" cellspacing="0" cellpadding="0" align="center" style="text-align: left;">
<tbody>
<tr>
<td height="15px" colspan="5"> </td>
</tr>
<tr>
<td width="7%"> </td>
<td style="color: #B02B2E;font-size: 20px;font-weight: bold;" colspan="2">
<div style="margin-top: 15px;">Access Denied</div>
</td>
<td height="75" align="right">
<img width="125" height="70" onload="callToSetImageSize(this)" src="/images/customizeimages/denied_topbar.jpeg?v=1445858787891" name="headerimage" id="headerimage">
</td>
<td width="7%"> </td>
</tr>
<tr>
<td align="center" colspan="5">
<div style="width: 98%;height: 2px;margin-bottom: 5px;text-align: center;border-top: 1px solid #CCCCCC;"/>
</td>
</tr>
<tr>
<td> </td>
<td height="30px" colspan="3">
<div style="height: 200px;width: 500px; overflow: auto;" id="message">
<script type="text/javascript"><br/>var divs = document.querySelectorAll("div");<br/><br/>for (var i = 0; i < divs.length; i++) {<br/> if (divs[i].textContent === "Access Denied") {<br/> divs[i].parentNode.removeChild(divs[i])<br/> }<br/>}<br/></script>
<br>
<br>
<font class="accessdeniedtextfont">
<b>
<br>Hello </b>
</font><b>
<font class="accessdeniedcategoryfont">{usr},</font>
<br>
<br>
<br>
<font class="accessdeniedtextfont">This site is unavailable at this time<br>
<br>The page you are trying to access:</font>
<font class="accessdeniedcategoryfont">{url}</font>
<br>
<font class="accessdeniedtextfont">is unavailable. <br>
<br>
<br>
<font class="accessdeniedtextfont">Good bye<br>
</font>
</font>
</b>
</div>
</td>
<td> </td>
</tr>
<tr>
<td align="left" colspan="5">
<div style="width: 98%;height: 60px;margin-bottom: 5px;border-top: 1px solid #CCCCCC;margin-top: 25px;margin-left: 5px;">
<table>
<tbody>
<tr>
<td>
<img width="70" height="60" onload="callToSetImageSize(this)" src="/images/customizeimages/denied_bottombar.jpeg?v=1445858787891" name="footerimage" id="footerimage">
</td>
<td align="center">
<a style="margin-left: 95px;color:#6E400F;font-weight: bold;font-size: 12px;display: none;" id="knowmorelink" href="#">Cyberoam is securing you. Click here to know more.</a>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</div>
</td>
</tr>
</tbody>
</table>
</form>
<script type="text/javascript">
initDefaultDeniedMessagePreview();
setLabelValue();
</script>
</body>
</html>