hello,

please check the below code, in div tag i have one text i want to change this text with new text when i click write button.. plz save this file as test.htm


<HTML>
<HEAD>
<script>
function WriteToFile()
{
var s=document.getElementById('txt');
var oldtxt=s.firstChild.nodeValue;
var newtxt="hi this is naveen";
var fso = new ActiveXObject("Scripting.FileSystemObject");
var FileObject = fso.OpenTextFile("D:\\testing\\test.htm", 8, true,0); // 8=append, true=create if not exist, 0 = ASCII
FileObject.write(newtxt)
FileObject.close()
}
</script>
</HEAD>
<BODY>
<a href="javascript:WriteToFile();">write</a>
<div id="txt">welcome man </div>
</BODY>
</HTML>