Hi,
To begin with I know absolutely nothing about javascript.........
I placed coding on my page to display to the date everyday but I would like
to change the font style........
This is the coding:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
// Get today's current date.
var now = new Date();
// Array list of days.
var days = new
Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
// Array list of months.
var months = new
Array('January','February','March','April','May','June','July','August','September','October','November','December');
// Calculate the number of the current day in the week.
var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();
// Calculate four digit year.
function fourdigits(number) {
return (number < 1000) ? number + 1900 : number;
}
// Join it all together
today = days[now.getDay()] + ", " +
months[now.getMonth()] + " " +
date + ", " +
(fourdigits(now.getYear())) ;
// Print out the data.
document.write(today);
// End -->
</script>
I don't like the font style that is being used and would therefore like to
change it. Please help............
GeoffMcGrath - 03 Dec 2007 05:20 GMT
You can try something like this:
document.write("<div style='font-family:Arial;color:blue'>" + today +
"</div>");
The best thing to do is probably to read up on CSS. Here's some
helpful links:
http://www.w3schools.com/css/css_font.asp
http://www.codestyle.org/css/font-family/
You're likely to get better help in a forum specific to javascript as
used in a browser....this forum is mostly oriented to jscript.net.
comp.lang.javascript might be a place to start...also, groups related
to CSS will best help with styling questions
Good luck!
Shelley - 03 Dec 2007 11:50 GMT
Hi, thank you for your response.
> You can try something like this:
> document.write("<div style='font-family:Arial;color:blue'>" + today +
[quoted text clipped - 12 lines]
>
> Good luck!