Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can't get function to load

Status
Not open for further replies.

battleangela

Technical User
May 25, 2007
11
US
Hi

I am new to writing java script and wanted to test things out. I started with a simple rpogram to load and display a function. I keep getting an error when I press the button and don't know what wrong. Can someone take a look and see whats wrong ?

<html>
<head>
<title>OpenObject Data</title>

<script language="javascript">
function displaytext()
{
document.getElementById('targetDiv').innerHTML="This message is brough you by javascript";
}

</script>

</head>
<body>
<h1>
Using a button to display results</h1>
<form>
<input type="button" onclick="displayText()" value="Click Me"/>
</form>
<div id="targetDiv">
</div>
</body>
</html>
 
>function displaytext()
[tt]function display[red]T[/red]ext()[/tt]
or change the onclick's handling call, one way or another.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top