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>