denizedenez
03-25-2005, 03:36 AM
Hello friends
I have the follow html page (do you can copy and save as test.htm, by example)
<div id="divOrigin">
<STYLE> <!-- .Test1 { color: #0000FF; font-weight: bold } .Test2 { color: #FF0000; font-weight: bold } --> </STYLE>
<span class='Test1'>Test1</span>
<span class='Test2'>Test2</span>
</div>
<div id="divDestination"></div>
<SCRIPT type="text/javascript">
<!--
function CopyContents(div1, div2)
{
div2.innerHTML = div1.innerHTML;
}
someDiv = document.getElementById("divOrigin");
otherDiv = document.getElementById("divDestination");
CopyContents(someDiv,otherDiv);
alert(someDiv.innerHTML);
alert(otherDiv.innerHTML);
//-->
</SCRIPT>
Please, check the contents of divOrigin, and the 2 alertboxes in Internet Explorer and FireFox...
IE (Alert1):
<STYLE> <!-- .Test1 { color: #0000FF; font-weight: bold } .Test2 { color:
#FF0000; font-weight: bold } --> </STYLE>
<span class='Test1'>Test1</span>
<span class='Test2'>Test2</span>
IE (Alert2), FireFox(Alert1) and FireFox(Alert2):
<span class='Test1'>Test1</span> <span class='Test2'>Test2</span>
I wish one EXACT COPY of contents from divOrigin to divDestination, but I know not how I can do it works in Firefox and IE... I need what all alerts show equals of IE(Alert1).
Someone can help me?
Denize
I have the follow html page (do you can copy and save as test.htm, by example)
<div id="divOrigin">
<STYLE> <!-- .Test1 { color: #0000FF; font-weight: bold } .Test2 { color: #FF0000; font-weight: bold } --> </STYLE>
<span class='Test1'>Test1</span>
<span class='Test2'>Test2</span>
</div>
<div id="divDestination"></div>
<SCRIPT type="text/javascript">
<!--
function CopyContents(div1, div2)
{
div2.innerHTML = div1.innerHTML;
}
someDiv = document.getElementById("divOrigin");
otherDiv = document.getElementById("divDestination");
CopyContents(someDiv,otherDiv);
alert(someDiv.innerHTML);
alert(otherDiv.innerHTML);
//-->
</SCRIPT>
Please, check the contents of divOrigin, and the 2 alertboxes in Internet Explorer and FireFox...
IE (Alert1):
<STYLE> <!-- .Test1 { color: #0000FF; font-weight: bold } .Test2 { color:
#FF0000; font-weight: bold } --> </STYLE>
<span class='Test1'>Test1</span>
<span class='Test2'>Test2</span>
IE (Alert2), FireFox(Alert1) and FireFox(Alert2):
<span class='Test1'>Test1</span> <span class='Test2'>Test2</span>
I wish one EXACT COPY of contents from divOrigin to divDestination, but I know not how I can do it works in Firefox and IE... I need what all alerts show equals of IE(Alert1).
Someone can help me?
Denize