Skip to content

Commit 3a5e6ee

Browse files
Merge pull request #29 from AzharAli-github/main
BOM
2 parents c383961 + 7e880fe commit 3a5e6ee

File tree

11 files changed

+51
-0
lines changed

11 files changed

+51
-0
lines changed
Loading
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="UTF-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>location-BOM</title>
9+
<link rel="shortcut icon" href="images/js-logo.png" type="image/x-icon">
10+
<link rel="stylesheet" href="style.css">
11+
</head>
12+
13+
<body>
14+
<h1>BOM Location In JS</h1>
15+
<button onclick="Display()">Click to View your current file Location</button>
16+
<div id="textOne">
17+
18+
</div>
19+
<script src="script.js"></script>
20+
</body>
21+
22+
</html>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
let textOne = document.getElementById('textOne');
2+
3+
function Display() {
4+
textOne.innerHTML = `
5+
<p>Window Location: ${window.location}</p>
6+
<p>Window Location Href: ${window.location.href}</p>
7+
<p>Window Location HostName: ${window.location.hostname}</p>
8+
<p>Window Location Path Name: ${window.location.pathname}</p>
9+
<p>Window Location Protocol: ${window.location.protocol}</p>
10+
<p>Refresh thr page....</p>
11+
`
12+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
p {
2+
font-size: 25px;
3+
font-family: cursive;
4+
}
5+
6+
button {
7+
background-color: transparent;
8+
border: 2px solid turquoise;
9+
font-size: 20px;
10+
border-radius: 5px;
11+
padding: 10px 20px;
12+
cursor: pointer;
13+
}
14+
15+
button:hover {
16+
background-color: turquoise;
17+
}

0 commit comments

Comments
 (0)