|
|
| (Une version intermédiaire par le même utilisateur non affichée) |
| Ligne 1 : |
Ligne 1 : |
| document.addEventListener('DOMContentLoaded', function () { | | document.addEventListener('DOMContentLoaded', function () { |
| // Add click event listeners to all elements with the class "toggle-column"
| | console.log('Custom JavaScript is loaded!'); |
| document.querySelectorAll('.toggle-column').forEach(function (element) {
| |
| element.addEventListener('click', function () { | |
| const target = this.getAttribute('data-target'); // Get the target column ID
| |
| // Hide all columns
| |
| document.querySelectorAll('.infobox-column').forEach(function (column) {
| |
| column.style.display = 'none';
| |
| });
| |
| // Show the selected column
| |
| document.getElementById(target).style.display = 'block';
| |
| | |
| // Update the styling of the active title
| |
| document.querySelectorAll('.toggle-column').forEach(function (title) {
| |
| title.style.fontWeight = 'normal';
| |
| });
| |
| this.style.fontWeight = 'bold';
| |
| });
| |
| });
| |
| }); | | }); |
|
| |
|
| document.addEventListener('DOMContentLoaded', function () {
| | alert('JavaScript is working!'); |
| console.log('JavaScript is loaded and running!');
| |
| });
| |
document.addEventListener('DOMContentLoaded', function () {
console.log('Custom JavaScript is loaded!');
});
alert('JavaScript is working!');