HTML-Kodu:
<!-- Paste this code into an external JavaScript file named: birthDay.js -->
/* This script and many more are available free online at
The JavaScript Source :: http://javascript.internet.com
Created by: Doc JavaScript :: http://www.webreference.com/js/tips/991021.html */
function findDay() {
var ar = new Array();
ar[0] = "Sunday";
ar[1] = "Monday";
ar[2] = "Tuesday";
ar[3] = "Wednesday";
ar[4] = "Thursday";
ar[5] = "Friday";
ar[6] = "Saturday";
var yourDay =prompt("Enter your Birthday Using the Format Below", "January 3, 1978")
var birthDay = new Date(yourDay);
var day = birthDay.getDay();
alert("You were born on " + ar[day]);
}
<!-- Paste this code into the HEAD section of your HTML document.
You may need to change the path of the file. --> <script type="text/javascript" src="birthDay.js"></script> <!-- Paste this code into the BODY section of your HTML document --> <form style="text-align: center;"> <input type="button" value="Find out what day of the week you were born on!" onclick="findDay()"> </form>