pass a html text in an input field using HTML DOM by innerHTML
<p>I have a problem in geting the html content from a div am pass it into an input field 
I'm using the following code:</p>

<pre><code>&lt;html&gt;
&lt;body&gt;
&lt;div id="void"&gt; 
&lt;div id="main"&gt;&lt;strong&gt;Hello&lt;/strong&gt; my friend&lt;/div&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;input type="text" id="resul" &gt;
&lt;br&gt;
&lt;script type="text/javascript"&gt;
x=document.getElementById("void").getElementsByTagName("div");
document.write("Text of first paragraph: " + x[0].innerHTML);
document.getElementById("resul").value=x[0].innerHTML;
&lt;/script&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>If you will try it, you will see what I mean. By using the command document.write() I get the value that I need from de div tag : "Hello my friend" but when I want to pass this value "Hello my friend" into an input field I get something like this "<strong>Hello</strong> my friend". 
How can I pass into the input field only the text "Hello friend" without  tag.</p>

<p>Any help would be much appreciated! Thanks!</p>
