HTML Code :-
<body onload="onLoad()">
<button id="dateBtn">Click me!</button>
</body>
Javascript Code :-
- function onLoad() {
- document.getElementById('dateBtn').onclick = function () {
- var dt = new Date();
- var NoOfDays = 10;
- dt.setDate(dt.getDate() + NoOfDays);
- alert(dt);
- };
- }
No comments :
Post a Comment