DHTML = HTML + CSS + JavaScript
Create a home.html that will:
User interaction: working with objects &
methods
1. Display today's date (pg.8.16)
document.write("text" + variable)
Create the following home.html:
<HTML>
<TITLE>Welcome</TITLE>
<HEAD>
<SCRIPT LANGUAGE="javascript">
var Today=new Date();
var Day=Today.getDate();
var Month=Today.getMonth();
var Year=Today.getFullYear();
document.writeln("<CENTER>Today
"+Month+"/"+Day+"/"+Year+"</CENTER>");
</SCRIPT>
</HEAD>
</HTML>
2. Display alert message
alert("message")
if (Today.getDay() == 2)
alert("Tuesday
is Senior Appreciation Day!")
3. Prompt user for his/her input:
prompt("message","default_text")
var ans=prompt("Do you want to register with us?", "Type
yes/no here:");
if (ans == "yes")
{
close();
window.open("form.html");
}
else
{
close();
window.open("frame.html");
}
4. Use buttons for page control
<BODY>
<FORM>
<CENTER>
<INPUT TYPE=button VALUE=Menu
OnClick="location='frame.html';">
<INPUT TYPE=button
VALUE=Register OnClick="location='form.html';">
</CENTER>
</BODY>