Problem dealing with double quotes in InnerHTML

  • Thread starter Thread starter Mahernoz
  • Start date Start date
M

Mahernoz

Hi Friends,

I have some problem here. I am using Asp.net 2.0 but that is not
relevant to my Question.

I have a <div> tag.
<div id="dvAArea" runat="server"></div>

and an HiddenField

<input type="hidden" runat="server" id="hidAArea" />

on click of a button i have a function

function CopyHTML()
{
document.getElementById('<%= hidAArea.ClientID %>').value
= MakeXMLParseable(document.getElementById('<%= dvAArea.ClientID
%>').innerHTML);

}

the problem here is i want to make the html of dvAArea Xml compatible.
but i am finding that the innerHTML property removes the double quotes
in IE6.

And as this removal occurs i cannot load it as a validXml (which is
used for other purpose).


putted simply i am finding trouble using innerHTML property with
Internet Explorer as it removes the "double quotes" from my rendered
html.
i am just looking for a way so that the double quotes are not removed
when innerHTML is called in Internet Explorer (mozilla works fine).


Regards,
Mahernoz
 
Hello Mahernoz,

Maybe I'm missing the point here but why don't you just use normal
HTML character codes? A quotation mark is represented by &quot;
You can also use &ldquo; and &rdquo; if you want left and right double
qutoation marks.


Manuel Ricca
 
Back
Top