This code should work;
but for some reason my local machine (firefox/win7) reports me as being exactly 1 month in the past.
therefore, i can't guarantee the accuracy of the Date() object.
something i'll have to look into next time i use Date() myself.
- Code: Select all
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META NAME="Generator" CONTENT="EditPlus">
<META NAME="Author" CONTENT="">
<META NAME="Keywords" CONTENT="">
<META NAME="Description" CONTENT="">
<style type="text/css">
.li_title { list-style-type:none;
font-size:12px;
line-height:24px;
}
.date {float:right;margin-right:3px;}
</style>
<script type="text/javascript"><!--
function doIt() {
var dt = new Date();
var date =
dt.getFullYear()
+ '-' + ( dt.getMonth()<10 ? '0'+dt.getMonth() : dt.getMonth() )
+ '-' + ( dt.getDate()<10 ? '0' + dt.getDate() : dt.getDate() );
var ul = document.getElementById('myUL');
for (var i = 0; i<ul.children.length; i++) {
var li = ul.children[i];
var span = li.children[0];
if (span.innerHTML==date) {
var html = '<img src="/path/to/img.jpg"/>';
li.innerHTML = html + li.innerHTML;
}
}
}
--></script>
</HEAD>
<BODY onload="doIt()">
<DIV id="Conttab_p_switch1" style="POSITION: relative">
<UL id="myUL">
<LI class="li_title"><span class="date">2011-04-22</span><A title=meeting(4-22) href="#" target=_blank>meeting(4-22)</A></LI>
<LI class="li_title"><span class="date">2011-04-11</span><A title=meeting(4-11) href="#" target=_blank>meeting(4-11)</A></LI>
<LI class="li_title"><span class="date">2011-04-04</span><A title=meeting(4-04) href="#" target=_blank>meeting(4-04)</A></LI>
</UL>
</DIV>
</BODY>
</HTML>