Difference between revisions of "MediaWiki:Common.js"
Jump to navigation
Jump to search
Line 14: | Line 14: | ||
$('#wagon-configurator li.wagon-slot').click(function(){ | $('#wagon-configurator li.wagon-slot').click(function(){ | ||
− | var wagonConfiguratorList = $('#wagon-configurator-list li.selected'). | + | var wagonConfiguratorList = $('#wagon-configurator-list li.selected')[0].classList[0]; |
− | alert("You selected " + wagonConfiguratorList | + | alert("You selected " + wagonConfiguratorList); |
}); | }); | ||
}); | }); |
Revision as of 19:29, 2 August 2021
/* Any JavaScript here will be loaded for all users on every page load. */ $(document).ready(function(){ var wagonConfiguratorList; var wagonSelection; $('#wagon-configurator-list li').click(function(){ $(this).addClass('selected'); $(this).siblings().removeClass('selected'); var wagonSelection = this.classList[0]; alert("You selected " + wagonSelection); console.log(wagonSelection); }); $('#wagon-configurator li.wagon-slot').click(function(){ var wagonConfiguratorList = $('#wagon-configurator-list li.selected')[0].classList[0]; alert("You selected " + wagonConfiguratorList); }); });