So you are on a page (your page) and you just want to extract all decimal digits and display them? But they are being displayed already ... where do you want to display them? Do you really mean digits or do you rather mean "full numbers"?
So you are on a page (your page) and you just want to extract all decimal digits and display them? But they are being displayed already ... where do you want to display them? Do you really mean digits or do you rather mean "full numbers"?
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<script type="text/javascript" >
window.onload=function(){
var str = document.getElementsByTagName('html')[0].innerHTML;
//var str = document.getElementsByTagName('body')[0].innerHTML; // string to be found must be in body
var x = str.match(/\d+/g); // digits
alert (x);
}
</script>
12345
67890
98765
</body>
</html>
I take it that you do understand that you can only detect the digits appearing in your own page, and not some other web page.
__________________
All the code given in this post has been tested and is intended to address the question asked.
Unless stated otherwise it is not just a demonstration.