-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday14.html
More file actions
43 lines (41 loc) · 1.21 KB
/
Copy pathday14.html
File metadata and controls
43 lines (41 loc) · 1.21 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Document</title>
</head>
<body>
<h1>Introduction to JAVASCRIPT</h1>
<script>
var name="Tom"
var name="Jerry"
console.log("my favorite cartoonn name is", name)
let num1=3347
console.log("The num1 value is",num1)
const pi=3.14
console.log("The constant pi value is", pi)
//Function
function greet(name,greeting){
document.write("hello </br>", greeting, "<br>" )
document.write(name, "<br>")
}
greet("Tom","Good Evening")
greet("Jerry","Good night")
function add(num1, num2){
console.log("The sum of two numbers is:", (num1+num2))
}
add(45,55)
var username= prompt("Enter the username:")
var password= prompt("Enter the password")
if(username=="Admin" && password=="pass"){
console.log("You are logged in")
else if(username=="Admin" || password=="pass")
{
console.log("The second data is correct")
}
else
{
console.log("invalid credentials")
}
</script>
</body>
</html>