<html>
<head>
<title>frame and button</title>
<script language="Javascript">
function sho(form)
{


document.writeln("click click boom!");
alert("clicked!);
form.tex1.value="abc";


}
</script>
</head>
<body>
<form name="cosine">
<input name="tex1" type="text"  value=" "><br><br>
<input name="button1"  type="button" value="click" onClick="sho(this.form)">
<input name="reset1" type="reset" value="clear">
</form>
</body>

</html>

What are you trying to do and why isnt it working?

Sorry to lazy to download your code, save it to a HTML file, and guess what it is your trying to do and what isnt working how you want it.

ia m trying to get the text displayed on clicking the button

So your trying to change the value of the submit button to "click click boom!"?

you cant call a "document.write/writeln" after a page has been loaded or it clears the screen. i just learned this myself. you have to work with the ".innerHTML" of the dom object.
so you create an object such as a div can call it by id. then edit the innerHTML

i learned a lot about this at this site: http://www.w3schools.com/

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.