I just want to remove contents inside script tag when i look into the console for result.
now it is showing informations along with correct results.
<script type="text/javascript">
var texta=document.documentElement.innerHTML;
var result = texta.match(/(.*)[:](.*)/g);
var rex = /(<([^>]+)>)/ig;
var htmltag=[];
//console.log(result)
for (index = 0; index < result.length; ++index) {
//console.log(index)
htmltag[index]=strip_html_tags(result[index]);
console.log(htmltag[index]. split(/[\<>&=:]/));
}
function strip_html_tags(str)
{
if ((str===null) || (str===''))
return false;
else
str = str.toString();
return str.replace(/<[^>]*>/g, '');
}
</script>
<html><li>Product Code : Product 15</li>
<li>Product Points : 100</li>
<span>Product : In Stock</span>
</html>
In console i am getting
- ["Product Code ", " Product 15"]
- ["Product Points ", " 100"]
- ["Product", "In Stock"]
- [" var result ", " texta.match(/(.*)", "/g);"]
- [" console.log(htmltag[index]. split(/[\", "", "", "]/));"]
i do not want 4th and 5th as it is come from inside javascript.