View Single Post
  #1 (permalink)  
Old July 27th, 2011, 01:02 PM
Ashu2912 Ashu2912 is offline
Registered User
 
Join Date: Jul 2011
Posts: 4
Thanks: 3
Thanked 0 Times in 0 Posts
Default 1st Chapter Example 2

It is mentioned that the program is interpreted from top to bottom. However, there is some odd behaviour given by the code below :-

Code:
<html>
<head>
<title> Title 1 </title>
</head>
<body>
HI!!!!
</body>
<script type = "text/javascript">
  alert ("Hi!!!");
  document.bgColor = "RED";
</script>
<head>
<title> Title 2 </title>
</head>
<body bgcolor = "YELLOW">
Hi!!! Again
</body>
<head>
<title> TITLE 2 </title>
</head>
</html>
I have mentioned the background colour to be yellow later in the program, but the webpage is being created red in colour, as mentioned in the <script>-</script> block!
Thanks!
Reply With Quote