I have this javascript date code which shows the day and date all on one line I need to have it show on two lines - so the top line shows the day and the line below shows the date Like this Original: Friday, November 14, 2008 What I need: Friday November 14, 2008 This is the code: <!--Place this script anywhere in a page.--> <!--NOTE: You do not need to modify this script.--> <SCRIPT language="JavaScript" type="text/javascript"> <!-- // current date - from http://rainbow.arch.scriptmania.com/scripts // Array of day names var dayNames = new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); var monthNames = new Array("January","February","March","April","May","June","July", "August","September","October","November","December"); var dt = new Date(); var y = dt.getYear(); // Y2K compliant if (y < 1000) y +=1900; document.write(dayNames[dt.getDay()]+ ", " + monthNames[dt.getMonth()] + " " + dt.getDate() + ", " + y ); // --> </SCRIPT> Code (markup): Thanks
document.write(dayNames[dt.getDay()]+ "<br/>" + monthNames[dt.getMonth()] + " " + dt.getDate() + ", " + y );
Thanks rene7705, I had originally tried the <br/> but with the "" lol.... now I know better Cheers.. rep added.