div.innerHTML in IE
Posted: Sun Jul 26, 2009 5:24 am
I have this content in div called "divPrimary".
And I am trying to copy this div value to a new one using javascript. Like this:
The problem is when I check the contents value in FF. It gives exactly like the content in HTML above. But in IE, It does not give the double quotes("). i.e.
Contents is like:
I could not figure it out, Why IE is not giving the exact values from HTML content.
Hope to get some reason from you guys.
Thanks
Code: Select all
<div id="divPrimary">
<table>
<tr>
<th> Name:</th>
<th><input type="text" [b]id="CPCONTACT_PERSON_NAME" name="CPCONTACT_PERSON_NAME"[/b] value="" /></th>
</tr>
<tr>
<th>Designation:</th>
<th><input type="text" id="CPCONTACT_PERSON_DESIGNATION" name="CPCONTACT_PERSON_DESIGNATION" value="" /></th>
</tr>
</table>
</div>
Code: Select all
var contents = document.getElementById(sdiv).innerHTML;
Contents is like:
Code: Select all
<table>
<tr>
<th> Name:</th>
<th><input [b]id=CPCONTACT_PERSON_NAME name=CPCONTACT_PERSON_NAME[/b] /></th>
</tr>
...
</table>
Hope to get some reason from you guys.
Thanks