I am trying to show and hide Elementor sections with a
jQuery(function() {
jQuery('#kategorije').change(function(){
jQuery('.usluge).hide();
jQuery('#' + jQuery(this).val()).show();
});
});
I was wondering is it possible to add multiple selection into the HTML Tag
<Select id="kategorije">
<option value="web"; "web2";"web3">Websajt</option>
Screenshots
2
Answers
I had to install the plugin that allowed me to insert the custom JS to the page it self
Here is the code
The example below will start with all items hidden (using a
CSS
class), and then show one after being selected. Change the selected option will hide the previous and show the newly selected one. You can apply the class to multiple elements.If you really want to use ; separated
id
then I have created a secondselect
demo where the value of the select option is split and then this array is cycled through, showing each element in turn.The code is fully commented.
Let me know if this wasn’t what you wanted.