What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » General » General Chit Chat » Javascript Help [SOLVED!]

Javascript Help [SOLVED!]
Author: Message:
scott2010_h
Full Member
***

Avatar

Posts: 187
Reputation: 10
32 / Male / Flag
Joined: Dec 2005
Status: Away
RE: Javascript Help (pownce & joost invite reward)
quote:
Originally posted by glennlopez
<head>
<script language="Javascript">
var element = document.getElementById("poop");
element.innerHTML = element.innerHTML.substr(0,4);
</script>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<div id="poop">hello world</div>
</body>
That won't work because the div is created after the script is called. So you need to place the code in after the div like this:
code:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<div id="poop">hello world</div>
<script language="javascript">
var element = document.getElementById("poop");
element.innerHTML = element.innerHTML.substr(0,4);
</script>
</body>
</html>


Tested it on my local server and it worked (Y)

This post was edited on 08-18-2007 at 07:34 AM by scott2010_h.
08-18-2007 07:34 AM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Javascript Help [SOLVED!] - by glennlopez on 08-18-2007 at 06:18 AM
RE: Javascript Help (pownce & joost invite reward) - by markee on 08-18-2007 at 06:39 AM
RE: Javascript Help (pownce & joost invite reward) - by glennlopez on 08-18-2007 at 07:18 AM
RE: Javascript Help (pownce & joost invite reward) - by scott2010_h on 08-18-2007 at 07:34 AM
RE: Javascript Help (pownce & joost invite reward) - by scott2010_h on 08-18-2007 at 08:33 AM
RE: Javascript Help (pownce & joost invite reward) - by glennlopez on 08-18-2007 at 09:01 AM
RE: Javascript Help (pownce & joost invite reward) - by scott2010_h on 08-18-2007 at 09:18 AM
RE: RE: Javascript Help (pownce & joost invite reward) - by glennlopez on 08-18-2007 at 09:27 AM
RE: Javascript Help (pownce & joost invite reward) - by scott2010_h on 08-18-2007 at 09:50 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On