0

Hi

How can I access the DOM (inner html).

I need to capture the innerhtml (the complete html , body structure)of the source page and then be able to open another html page using this inner html of the page selected.

I tried different methods like using the ajax calls and document.getElementById.innerHtml....
but they only retrieve the source (not the complete html --- html that we see in fire bug)

Can any body please help me on this issue (any examples ).

thanks
Nash

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by __avd
0

Three methods of document object can be used :
1. document.getElementsByTagName("html");
2. document.getElementById("id");
3. document.getElementsByName("elename");

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html   id="p1" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Inner HTML</title>
   <script type="text/javascript">
      function show() {
            var t=document.getElementsByTagName("html").item(0);
            alert(t.innerHTML);
         }
   </script>  
</head>
<body>
    <form id="form1">
      <div>
        Something...
         <button onclick="show()">Show InnerHTML</button>
      </div>
    </form>
</body>
</html>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.