Solved

Help with basic javascript syntax

Posted on 2014-09-17
3
85 Views
Last Modified: 2014-09-17
Can someone tell me what is wrong with the following
<!DOCTYPE HTML>
<html>
  <head>
  <script type="text/javascript">
  function TextInsert() {
	document.getElementById("MyEdit").innerHtml="My new text!";
  }
  </script>
  </head>
  <body onload=TextInsert()>
  <div id="MyEdit">&nbsp;</div>
  </body>
</html>      

Open in new window

0
Comment
Question by:Gary Samuels
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 33

Assisted Solution

by:Big Monty
Big Monty earned 250 total points
ID: 40328241
javascript is case sensitive, change your code to:

document.getElementById("MyEdit").innerHTML="My new text!";

also, put your function call in quotes:

<body onload="TextInsert():>
0
 
LVL 58

Accepted Solution

by:
Gary earned 250 total points
ID: 40328243
Check the case

document.getElementById("MyEdit").innerHTML="My new text!";
0
 

Author Closing Comment

by:Gary Samuels
ID: 40328257
Thanks
0

Featured Post

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

632 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question