<html> <head> <title></title> <script type="text/javascript"> function useRanges() { alert(document.body.innerHTML); } </script> </head> <body><p id="p1"><b>Hello</b> World</p> <input type="button" value="Use Ranges" onclick="useRanges()" /> </body> </html>