Reputation: 1
So I know this is a super noob question but after adding a script tag for a .js file,my title element stops working.
As an example :
<html>
<title>TEST</title>
<head>
<script type="text/javascript" src="datetime.js"></script>
</head>
<body onload="showDateTime()">
<p>
</p>
</body>
</script>
</html>
yet if I delete the "<script type="text/javascript" src="datetime.js"></script>"
portion, the title element works again. ANy help would be appreciated. Thanks
Upvotes: 0
Views: 199
Reputation: 4937
Two problems:
<head></head>
The <script>
tag is incorrectly nested. It must be closed in the head
<html>
<head>
<title>TEST</title>
<script type="text/javascript" src="datetime.js"></script>
</head>
<body onload="showDateTime()">
<p id='datetime-container'>
</p>
</body>
</html>
The code above should work.
Upvotes: 1
Reputation: 1715
The title tag needs to be inside the head.
http://www.w3schools.com/html/html_head.asp
Upvotes: 0