Todaysdate
Todaysdate
Experiment No: 10
Date:
Relevant CO: 2
Objectives:
Javascript
o Internal Javascript
▪ JavaScript code is placed in the head and body section of an HTML page.
▪ Example
o External JavaScript
▪ If you want to use the same script on several pages it could be good idea to
place the code in separate file, rather than writing it on each.
▪ JavaScript code are stored in separate external file using the .js extension
(Ex: external.js).
Implementation:
<script>
const today = new Date();
Output:
Conclusion:
The JavaScript provided effectively retrieves and displays the current date in a user-friendly format. By
using the built-in Date object and toLocaleDateString() method, it ensures accurate and localized date
formatting. This simple script can be easily integrated into any webpage to dynamically show today's
date. It enhances user experience by providing up-to-date information automatically. Overall, it's a
practical and efficient solution for displaying the current date on a website.
Quiz:
1. What is javascript?
Ans:
JavaScript is a high-level, interpreted programming language used primarily for web development. It
enables dynamic content, interactivity, and client-side scripting in web browsers. JavaScript can
manipulate HTML, CSS, and handle events, making web pages more interactive. It is also used in
server-side development (Node.js), mobile applications, and game development.
Suggested Reference:
● https://www.w3schools.com/JSREF/jsref_obj_date.asp
References used by the students:
● https://www.w3schools.com/JSREF/jsref_obj_date.asp
Rubrics 1 2 3 Total
Marks