-
Notifications
You must be signed in to change notification settings - Fork 0
/
occasions2.html
49 lines (45 loc) · 1.39 KB
/
occasions2.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html>
<head>
<style>
html {
text-align: center;
background-color: blue;
}
h1{ font-family: arial;
font-size: 120%;
}
p{ font-family: arial;}
</style>
<img src="BirthdayCake.jpg" alt="Birthday Cake" style="width:350px;height:228px">
<h1><strong>Dates to Remember</strong></h1>
</head>
<body>
<p >Occasion to remember</p>
<input type="text" id="myTextField" placeholder="What do you need to remember?" style="width: 200px;"/>
<p >Date of Occasion (mm/dd)</p>
<input type="text" id="myDate" placeholder="What date is it?" style="width: 100px;"/>
<br>
<input type="submit" id="byBtn" value="Enter" onclick="change()"/>
<br>
<p id ="title"><p> <p id ="newdate"></p>
<script>
function change(){
var myNewOccasion = document.getElementById('myTextField').value;
var myNewDate = document.getElementById('myDate').value;
if( myNewOccasion.length==0 ){
alert('Write Some real Text please.');
return;
}
if( myNewDate.length==0){
alert('Youre not going to remember the date if you dont enter it.');
return;
}
var occasion = document.getElementById('title');
occasion.innerHTML = myNewOccasion;
var date = document.getElementById('newdate');
date.innerHTML = myNewDate;
}
</script>
</body>
</html>