DIV contents not updated in Firefox when using DIV.innerHTML

M

Mahernoz

Task to be Accomplished: I want to copy the contents of dvAArea (after
i change a value in the dropdown or a textbox) into the new dvBArea

Problem: In Internet explorer this code works fine but Firefox gives
the unchanged content of dvAArea (and not the current content). I want
the current content of dvAArea in Firefox after i change the values in
the dropdown or text fields.

//My Page is as follows
//I am having 2 div
<div id="dvBArea"></div>
<div id="dvAArea">
<table>
<tr>
<td>
<input id="txtA0101" name="txtA0101" type="text"></td>

<td>
<input id="txtA0102" name="txtA0102" type="text"></td>

<td>
<select id="sel0106" name="sel0106">
<option value="300">300</option>
<option value="600">600</option>
<option selected="selected" value="1200">1200</
option>
<option value="2400">2400</option>
</select>
</td>
</tr>
</table>
</div>

//and a JavaScript function CopyHTML which is raised on onclick event
of a button
<input id="btnClickMe" type="button" value="Copy"
onclick="CopyHTML()"/>

//the CopyHTML function is as follows
<script language="javascript" type="text/javascript">
function CopyHTML()
{

document.getElementById('dvBArea').innerHTML =
document.getElementById('dvAArea').innerHTML;
}


</script>


Regards,
Mahernoz
 
P

Peter Duniho

Task to be Accomplished: I want to copy the contents of dvAArea (after
i change a value in the dropdown or a textbox) into the new dvBArea

Problem: In Internet explorer this code works fine but Firefox gives
the unchanged content of dvAArea (and not the current content). I want
the current content of dvAArea in Firefox after i change the values in
the dropdown or text fields.

I don't see a single thing in your question that makes it even remotely
on-topic here. There's no C#, and there's not even any explicit use of
the .NET framework.

You should find a newsgroup that is specific to questions about writing
HTML and/or about Firefox HTML issues specifically. Not only will you
avoid cluttering this newsgroup with the off-topic discussion, but more
importantly you'll be much more likely to receive an answer you can use.

Pete
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top