cg-select/example/example.js

49 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-12-28 20:35:00 +03:00
const firstBtn = document.getElementById('first');
const codeFirst = document.getElementById('codeFirst');
const secondBtn = document.getElementById('second');
const codeSecond = document.getElementById('codeSecond');
const thirdBtn = document.getElementById('third');
const codeThird = document.getElementById('codeThird');
const fourthBtn = document.getElementById('fourth');
const codeFourth = document.getElementById('codeFourth');
const fifthBtn = document.getElementById('fifth');
const codeFifth = document.getElementById('codeFifth');
2023-02-15 19:49:17 +03:00
const six = document.getElementById('six');
2022-12-28 20:35:00 +03:00
const codeSix = document.getElementById('codeSix');
2023-02-15 19:49:17 +03:00
const Native = document.getElementById('Native');
const codeNative = document.getElementById('codeNative');
2022-12-28 20:35:00 +03:00
firstBtn.addEventListener('click', () => {
2023-02-15 19:49:17 +03:00
codeFirst.classList.toggle('active');
});
2022-12-28 20:35:00 +03:00
secondBtn.addEventListener('click', () => {
2023-02-15 19:49:17 +03:00
codeSecond.classList.toggle('active');
});
2022-12-28 20:35:00 +03:00
thirdBtn.addEventListener('click', () => {
2023-02-15 19:49:17 +03:00
codeThird.classList.toggle('active');
});
2022-12-28 20:35:00 +03:00
fourthBtn.addEventListener('click', () => {
2023-02-15 19:49:17 +03:00
codeFourth.classList.toggle('active');
});
2022-12-28 20:35:00 +03:00
fifthBtn.addEventListener('click', () => {
2023-02-15 19:49:17 +03:00
codeFifth.classList.toggle('active');
});
2022-12-28 20:35:00 +03:00
six.addEventListener('click', () => {
2023-02-15 19:49:17 +03:00
codeSix.classList.toggle('active');
});
2022-12-28 20:35:00 +03:00
Native.addEventListener('click', () => {
2023-02-15 19:49:17 +03:00
codeNative.classList.toggle('active');
});