Hi,
I have iFrame in which I have a div and the contents of the div are dynamically changed using javascript. When I use innerHTML it clears quotes. So is there any way that I can get the contents of the tag?
Is there any why I could get the output with quotes for id and class?
Thanks
Gorge
I have iFrame in which I have a div and the contents of the div are dynamically changed using javascript. When I use innerHTML it clears quotes. So is there any way that I can get the contents of the tag?
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style>
span.fill-in{background-color: yellow;}
</style>
</HEAD>
<BODY>
<FORM METHOD=POST ACTION="">
<INPUT TYPE="text" NAME="test_id" value="hello my test">
<INPUT TYPE="button" value="test" onClick="call('test_id')">
</FORM>
<div id="clause_text">
this is a <span id="test_id1" class="fill-in">test</span> hello
</div>
<SCRIPT LANGUAGE="JavaScript">
<!--
function call(obj){
var id = document.getElementById(obj).name;
var value = document.getElementById(id).value;
//var spanObj = document.getElementById(id+"1");
alert(document.getElementById('clause_text').innerHTML);
//document.write($('clause_text').innerHTML);
}
//-->
</SCRIPT>
</BODY>
</HTML>
Is there any why I could get the output with quotes for id and class?
Code:
this is a <span id="test_id1" class="fill-in">test</span>
Thanks
Gorge