S
Sergio del Amo
i,
I have the next html page
<html>
<head>
<script>
<!--
function insertcode()
{
var code ="<p> blablabal babala babababab</p><h1>here comes
header</h1><span>fadfafa<a href=\"fadfaf\">anchor</a>blalbababa</span>"
var myText = document.createTextNode(code);
document.getElementById("content").appendChild(myText);
}
-->
</script>
</head>
<body>
<div id="content">
</div>
<a href="javascript:insertcode()">Insert Code</a>
</body>
</html>
This code insert the data as text. The html tags are not treated like
markup. I need to insert the code in a time. I mean i CAN NOT go tag per
tag. (E.g. document.createElement("p")... )
Is there any method to insert a pice of html code into a div and keep it
like code not like text in Javascript?
I hope you understand my problem. If not please tell me. Thanks in
advanced for your help.
I have the next html page
<html>
<head>
<script>
<!--
function insertcode()
{
var code ="<p> blablabal babala babababab</p><h1>here comes
header</h1><span>fadfafa<a href=\"fadfaf\">anchor</a>blalbababa</span>"
var myText = document.createTextNode(code);
document.getElementById("content").appendChild(myText);
}
-->
</script>
</head>
<body>
<div id="content">
</div>
<a href="javascript:insertcode()">Insert Code</a>
</body>
</html>
This code insert the data as text. The html tags are not treated like
markup. I need to insert the code in a time. I mean i CAN NOT go tag per
tag. (E.g. document.createElement("p")... )
Is there any method to insert a pice of html code into a div and keep it
like code not like text in Javascript?
I hope you understand my problem. If not please tell me. Thanks in
advanced for your help.