-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbutton.js
More file actions
23 lines (19 loc) · 1.3 KB
/
Copy pathbutton.js
File metadata and controls
23 lines (19 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
const buttonBox = document.getElementById('button_box')
let locationSearch = window.location.search
let hrefLink = ''
if (locationSearch === '?task_1') hrefLink = `index_solution.html${locationSearch}`
if (locationSearch === '?task_2') hrefLink = `index_solution.html${locationSearch}`
if (locationSearch === '?task_3') hrefLink = `index_solution.html${locationSearch}`
if (locationSearch === '?task_4') hrefLink = `index_solution.html${locationSearch}`
if (locationSearch === '?task_5') hrefLink = `index_solution.html${locationSearch}`
if (locationSearch === '?task_6') hrefLink = `index_solution.html${locationSearch}`
if (locationSearch === '?task_7') hrefLink = `index_solution.html${locationSearch}`
if (locationSearch === '?task_8') hrefLink = `index_solution.html${locationSearch}`
if (locationSearch === '?task_9') hrefLink = `index_solution.html${locationSearch}`
if (locationSearch === '?task_10') hrefLink = `index_solution.html${locationSearch}`
if (locationSearch === '?task_11') hrefLink = `index_solution.html${locationSearch}`
if (locationSearch === '?task_12') hrefLink = `index_solution.html${locationSearch}`
const buttonCodeHTML = `<button class='button'>
<a href=${hrefLink} class='button_link'>Решение</a>
</button>`
if (buttonBox) buttonBox.insertAdjacentHTML('afterbegin', buttonCodeHTML)