vForums Support > Programming & Coding :: Database of Codes/Hacks/Mods :: > Change Color of Today & Yesterday
Change Color of Today & Yesterday - Posted By Michael (wrighty) on 16th Mar 08 at 1:29pm
This will allow you to color the words: Today & Yesterday.
The red part is the color that Today will be changed to, and the green part is the color that Yesterday will be changed to.
<script>
/*Change Color of Today & Yesterday
Coded By Wrighty
No Ripping, Reposting or Claiming*/
var _t = '#FF0000';
var _y = '#00FF00';
var _d = get('td','tag');
for(i=0;i<_d.length;i++){
if(_d[i].innerHTML.match(/(>Today<|Yesterday)/)){
switch (RegExp.$1){
case 'Yesterday':
var _n = '<font color='+_y+'>Yesterday</font>';
break;
case '>Today<':
var _n = '><font color='+_t+'>Today</font><';
break;
}
_d[i].innerHTML = _d[i].innerHTML.replace(RegExp.$1,_n);
}
}
</script>
Global Footer