Anwendungsbeispiel: Ein Textfeld soll nur sichtbar sein, wenn aus dem davor positionierten Dropdown keine Auswahl getroffen wurde.
(function($) {
$('.shownext').change(function() {
if ($(this).prop('selectedIndex') == 0) {
$(this).next('input').show();
} else {
$(this).next('input').hide();
}
});
$('.shownext').each(function() {
if ($(this).prop('selectedIndex') == 0) {
$(this).next('input').show();
} else {
$(this).next('input').hide();
}
});
})(jQuery);
Version jQuery 1.12.4
Schreibe einen Kommentar