diff --git a/source/plg_system_t3/base-bs3/js/frontend-edit.js b/source/plg_system_t3/base-bs3/js/frontend-edit.js index 08e8c03f3c..410559cc7b 100644 --- a/source/plg_system_t3/base-bs3/js/frontend-edit.js +++ b/source/plg_system_t3/base-bs3/js/frontend-edit.js @@ -24,7 +24,7 @@ //add class on/off $('fieldset.t3onoff').find('label').addClass(function(){ - var $this = $(this), $input = $this.prev('input'), + var $this = $(this), $input = $('#' + $this.attr('for')), cls = $this.hasClass('off') || $input.val() == '0' ? 'off' : 'on'; cls += $input.prop('checked') ? ' active' : ''; return cls; diff --git a/source/plg_system_t3/base/js/frontend-edit.js b/source/plg_system_t3/base/js/frontend-edit.js index e8e3871351..99e6c50929 100644 --- a/source/plg_system_t3/base/js/frontend-edit.js +++ b/source/plg_system_t3/base/js/frontend-edit.js @@ -24,7 +24,7 @@ //add class on/off $('fieldset.t3onoff').find('label').addClass(function(){ - var $this = $(this), $input = $this.prev('input'), + var $this = $(this), $input = $('#' + $this.attr('for')), cls = $this.hasClass('off') || $input.val() == '0' ? 'off' : 'on'; cls += $input.prop('checked') ? ' active' : ''; return cls;