18/08/25
This commit is contained in:
48
static/js/cases.js
Normal file
48
static/js/cases.js
Normal 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);
|
||||
});
|
||||
Reference in New Issue
Block a user