-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
40 lines (39 loc) · 1.59 KB
/
app.js
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
// Buttons
const homeBtn = document.getElementById("home")
const exploreBtn = document.getElementById("explore")
const messageBtn = document.getElementById("message")
const bookmarkBtn = document.getElementById("bookmark")
const listbtn = document.getElementById("list")
const profileBtn = document.getElementById("profile")
const morebtn = document.getElementById("more")
console.log(messageBtn)
// sections
const secondSection = document.querySelector(".mainly")
const homeSection = document.querySelector(".home-section")
const exploreSection = document.querySelector(".explore-section")
const messageSection = document.querySelector(".message-section")
const bookmarkSection = document.querySelector(".bookmark-section")
const listSection = document.querySelector(".list-section")
const profileSection = document.querySelector(".profile-section")
const moreSection = document.querySelector(".more-section")
homeBtn.addEventListener("click", function (e) {
secondSection.innerHTML = homeSection.innerHTML
})
exploreBtn.addEventListener("click", function (e) {
secondSection.innerHTML = exploreSection.innerHTML
})
messageBtn.addEventListener("click", function (e) {
secondSection.innerHTML = messageSection.innerHTML
})
bookmarkBtn.addEventListener("click", () => {
secondSection.innerHTML = bookmarkSection.innerHTML
})
listSection.addEventListener("click", () => {
secondSection.innerHTML = listSection.innerHTML
})
profileBtn.addEventListener("click", () => {
secondSection.innerHTML = profileSection.innerHTML
})
morebtn.addEventListener("click", () => {
secondSection.innerHTML = moreSection.innerHTML
})