codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Newbie Help!  TheShadow at 05:07 on Monday, March 21, 2005
 

Write a JavaScript program that checks the system time and then
based on the following rules: -
If the time is after 12:00am (midnight) but before 12:00 pm (noon)
loop to display the numbers from 1 to 10 in a list down the page.
should be white and the font size 16 point, and the background navy.
If the time is after 12:00pm (noon) but before 12:00am (midnight)
display the numbers from 20 to 30 in a list across the page. The digits
be yellow and the font size 14 point, and the background navy.


[code]
h1 {
font-size: 16px;
color:#FFFFFF;
background-color:#000066
}

h2 {
font-size: 14px;
color: #FFFF00;
background-color:#000066
}

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en">

<head>
<title>Time</title>
<link rel="stylesheet" href="/forum/time.css" type="text/css" />
</head>
<body>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


<html xmlns="http://www.w3.org/1999/xhtml"
xml:lang="en" lang="en">

<head>
<title>Time</title>
<link rel="stylesheet" href="/forum/time.css" type="text/css" />
<script type="text/JavaScript">
//<![CDATA[
var d = new Date()
while (d.getHours <= "0" && < "12")
{
document.write("<h1>1</h1><br />");
document.write("<h1>2</h1><br />");
document.write("<h1>3</h1><br />");
document.write("<h1>4</h1><br />");
document.write("<h1>5</h1><br />");
document.write("<h1>6</h1><br />");
document.write("<h1>7</h1><br />");
document.write("<h1>8</h1><br />");
document.write("<h1>9</h1><br />");
document.write("<h1>10</h1>");
}

for ()
{
document.write("<h2>20 </h2>");
document.write("<h2>21 </h2>");
document.write("<h2>22 </h2>");
document.write("<h2>23 </h2>");
document.write("<h2>24 </h2>");
document.write("<h2>25 </h2>");
document.write("<h2>26 </h2>");
document.write("<h2>27 </h2>");
document.write("<h2>28 </h2>");
document.write("<h2>29 </h2>");
document.write("<h2>30 </h2>");
}
//]]>
</script>
</head>
<body>
</body>
</html>
</body>
</html>
[/code]

Am i on the right track?








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: Shopping Cart -
•  Shopping cart
•  Altering Text Fields,
•  how to set up the project in vc ++ for the class with container member data?
•  new guy looking for simple stub app
•  in vc++ 5.0, get a lot of errors when compile, like, C2501: `string` : missing decl-specifiers etc.
•  Re: Zip/Unzip using Asp.Net without using any third party controls.
•  Jtable
•  Newbie Help!


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005