Graduate Date
<!DOCTYPE html>
<html>
<body>
<h1>離畢業日期還有幾天</h1>
年<input type=input id="p1"><br>
月<input type=input id="p2"><br>
日<input type=input id="p3">
<input type=button onclick="myFunction()" value="算算看">
<p id="demo"></p>
<script>
function myFunction() {
var p1= document.getElementById("p1").value;
var p2= document.getElementById("p2").value;
var p3= document.getElementById("p3").value;
var today =new Date();
var graduate = new Date();
graduate.setFullYear(p1,p2-1,p3);
document.getElementById("demo").innerHTML =
(graduate-today)/1000/60/60/24;
}
function yourFunction() {
var p1= document.getElementById("p1").value;
document.getElementById("demo").innerHTML = (p1-32)*5/9;
}
</script>
</body>
</html>