So what I'm trying to do is to show currently hidden custom field when a certain option from the dropdown menu is selected but can't seem to achieve this. Or in other words, after clicking on the specific option I would like to change the CSS on the currently hidden field from display:none to display:block.
I've managed to achieve that the custom field displays after clicking anywhere on the select menu with the code below, but this isn't enough. The hidden field should display only if you choose a specific option.
So this works...
jQuery('#select-menu').click(function() {
jQuery('.custom-field-wrapper').css('display', 'block');
});
But this doesn't...
jQuery('#select-menu option:last').click(function() {
jQuery('.custom-field-wrapper').css('display', 'block');
});
Any idea what I'm doing wrong and how to fix or workaround this?