This commit is contained in:
2025-10-18 00:08:36 +09:00
parent 18bfdf9c4e
commit 4833b4ba28
5 changed files with 421 additions and 0 deletions

48
static/js/cases.js Normal file
View File

@@ -0,0 +1,48 @@
// function change(){
// if (document.getElementById('radio1').checked && document.getElementById('radio2').checked == false){
// linkTao.style.display = 'block';
// textTao.style.display = 'none';
// console.log(1)
// }
// else if (document.getElementById('radio1').checked == false && document.getElementById('radio2').checked){
// textTao.style.display = 'block';
// linkTao.style.display = 'none';
// console.log(2)
// }
// else{
// textTao.style.display = 'none';
// linkTao.style.display = 'none';
// console.log(3)
// }
// }
document.addEventListener('DOMContentLoaded', function () {
const radio1 = document.getElementById('radio1');
const radio2 = document.getElementById('radio2');
const linkTao = document.getElementById('inputLink');
const textTao = document.getElementById('inputText');
function toggleInputs() {
if (radio1.checked) {
linkTao.style.display = 'flex';
textTao.style.display = 'none';
console.log(1);
} else if (radio2.checked && radio1.checked == false) {
linkTao.style.display = 'none';
textTao.style.display = 'flex';
console.log(2);
} else {
linkTao.style.display = 'none';
textTao.style.display = 'none';
console.log(3);
}
}
linkTao.style.display = 'none';
textTao.style.display = 'none';
radio1.addEventListener('click', toggleInputs);
radio2.addEventListener('click', toggleInputs);
});