Jump to content

Procat

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by Procat

  1. Procat

    Help!

    Try:<html><head><script type="text/javascript">function disp_prompt() { var year=prompt('Please write the year you were born','1950'); var age=2006-year; document.write('Hello, you are' + age + 'years old!'); }</script></head><body><input type="button" onclick="disp_prompt()" value="Click here" /></body></html>
  2. This might be more correct, assuming the external javascriptfile is called external.js. This is the Javascript filefunction Test() {var d = new date()var time = d.getHours()if (time<10){document.write ("<b>Suba Udesanak</b>")}else if (time>=10 && time<16){document.write ("<b> Suba Dawask </b>")}else{document.write ("<b>Hello All!</b>")alert ("Hello All)}}And this is the Html document.<html><head><title> My fIrst JavaScript Test</title><link rel= "stylesheet" type="text/css" href="jsstyle1.css"/><script type="text/javascript" src="external.js"></script></head><body><script>test();</script><h1>JS & CSS Practical Test Site</h1><p>This is a simple test site. This is a simple test site. This is a simple test site. This is a simple test site. Thisis a simple test site. This is a simple test site. This is a simple test site. This is a simple test site. This is asimple test site. This is a simple test site. This is a simple test site. This is a simple test site. This is asimple test site. This is a simple test site. This is a simple test site. This is a simple test site. This is asimple test site. This is a simple test site. This is a simple test site. This is a simple test site.</p>//Therea are another more tags in the body section.. but I think those are not necessary for this.</body></html>
×
×
  • Create New...