Set NEW Indicator to Expire

[Total: 0    Average: 0/5]

This shows how to have an image appear next to some other item on your page, where that image shows “NEW” (it shows a ball here)

Body Code:

<script type=text/javascript>
var image = "http://www.js-examples.com/js/pic1.gif"; // your "NEW" image

function expnew(when) {
  when = new Date(when);
  date = new Date();
  if (when.getTime() > date.getTime()) {
    document.write("<img height=10 src="+image+">")
  }
}
document.write("<BR>Is not new after 2/3/2000");expnew("2/3/2000");
document.write("<BR>Is not new after 2/3/2010");expnew("2/3/2010");
</script>

Times Viewed: 0

Leave a Reply

Your email address will not be published. Required fields are marked *