What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Javascript Problem ...again (rewarding with joost or/and pownce invite)

Javascript Problem ...again (rewarding with joost or/and pownce invite)
Author: Message:
glennlopez
New Member
*


Posts: 6
Joined: Jun 2005
O.P. Cool  Javascript Problem ...again (rewarding with joost or/and pownce invite)
Problem:
I can't seem to get the javascript to work on every div ID'ed with 'datesup' and 'datesub'. (it'll only work once on the first DIV with the ID datesup and datesub.

Question
How can I make my javascript work for any and ALL the DIV tag with the ID 'datesup' and 'datesub' ?

code:
<html ..etc...


<body>
NUMBER:
<div id="poop">18 August 2007</div>
<script language="javascript">
var element = document.getElementById("poop");
element.innerHTML = element.innerHTML.substr(0,2);
</script>
<p>
MONTH:
<div id="goop">18 August 2010</div>
<p>
<script language="javascript">
var element = document.getElementById("goop");
element.innerHTML = element.innerHTML.replace(/[*0-9]/g,'');
</script>
</p>




<div>
<div style="background-image:url(http://img292.imageshack.us/img292/2955/datesupbgrb5.gif); width:400px; height:30px; background-repeat:no-repeat; font-family:Arial, Helvetica, sans-serif; color:#FFFFFF; font-size:28px;"><div id="datesup" style=" margin-left:10px;">27 November 2007</div>
</div>

<div id="datesub" style="background-image:url(http://img215.imageshack.us/img215/993/datesubbgck1.gif); width:54px; height:14px; background-repeat:no-repeat; text-align:center; font-family:Arial, Helvetica, sans-serif; color:#FFFFFF; font-size:10px; margin-top:0px;">18 January 2007
</div>
</div>

<p>

<div>
<div style="background-image:url(http://img292.imageshack.us/img292/2955/datesupbgrb5.gif); width:400px; height:30px; background-repeat:no-repeat; font-family:Arial, Helvetica, sans-serif; color:#FFFFFF; font-size:28px;"><div id="datesup" style=" margin-left:10px;">27 November 2007</div>
</div>

<div id="datesub" style="background-image:url(http://img215.imageshack.us/img215/993/datesubbgck1.gif); width:54px; height:14px; background-repeat:no-repeat; text-align:center; font-family:Arial, Helvetica, sans-serif; color:#FFFFFF; font-size:10px; margin-top:0px;">18 January 2007
</div>
</div>

<script language="javascript">
var element = document.getElementById("datesup");
element.innerHTML = element.innerHTML.substr(0,2);
</script>
<script language="javascript">
var element = document.getElementById("datesub");
element.innerHTML = element.innerHTML.replace(/[*0-9]/g,'');
</script>

</body>



..../html>


This post was edited on 08-22-2007 at 11:31 PM by glennlopez.
08-22-2007 11:30 PM
Profile E-Mail PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Javascript Problem ...again (rewarding with joost or/and pownce invite) - by glennlopez on 08-22-2007 at 11:30 PM
RE: Javascript Problem ...again (rewarding with joost or/and pownce invite) - by rav0 on 08-23-2007 at 07:57 AM
RE: Javascript Problem ...again (rewarding with joost or/and pownce invite) - by Nathan on 08-23-2007 at 08:23 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