How to display the contents of a div from one document to another? For example, there is one document, it says the following:

<div id="bla bla">(Содержимое)</div>. 

And I need to print the contents of the div in another document. How can this be done in html?

    3 answers 3

    Can PHP

     <div id="divTag"> <?php include "inner.html"; ?> </div> 

    inner.html
    Content

      On pure html using iframe only:

      Document1.html:

       <div id="divTag"><iframe src="inner.html" frameborder="0" style="border:0px;width:100%;"></iframe></div> 

      Document2.html:

       <div id="divTag"><iframe src="inner.html" frameborder="0" style="border:0px;width:100%;"></iframe></div> 

      inner.html:

       Содержимое, которое будет в doc1 и в doc2 

        And you can: with jQuery.

         $('#result').load('ajax/test.html #container'); 

        Here is the detail: .load () .