diff --git a/core/misc/ajax.js b/core/misc/ajax.js
index e2aeab1..1734d9f 100644
--- a/core/misc/ajax.js
+++ b/core/misc/ajax.js
@@ -22,7 +22,7 @@
   Drupal.behaviors.AJAX = {
     attach: function (context, settings) {
 
-      function loadAjaxBehavior(base) {
+      function loadAjaxBehavior (base) {
         var element_settings = settings.ajax[base];
         if (typeof element_settings.selector === 'undefined') {
           element_settings.selector = '#' + base;
@@ -104,9 +104,7 @@
     try {
       statusText = "\n" + Drupal.t("StatusText: !statusText", {'!statusText': $.trim(xmlhttp.statusText)});
     }
-    catch (e) {
-      // empty
-    }
+    catch (e) {}
 
     responseText = '';
     // Again, we don't have a way to know for sure whether accessing
@@ -712,7 +710,7 @@
       // :even and :odd are reversed because jQuery counts from 0 and
       // we count from 1, so we're out of sync.
       // Match immediate children of the parent element to allow nesting.
-      $(response.selector).find('> tbody > tr:visible, > tr:visible')
+      $(response.selector).find('> tbody > tr, > tr').filter(':visible')
         .removeClass('odd even')
         .filter(':even').addClass('odd').end()
         .filter(':odd').addClass('even');
diff --git a/core/misc/tabledrag.js b/core/misc/tabledrag.js
index 61f8e29..f52d879 100644
--- a/core/misc/tabledrag.js
+++ b/core/misc/tabledrag.js
@@ -21,7 +21,7 @@
    */
   Drupal.behaviors.tableDrag = {
     attach: function (context, settings) {
-      function initTableDrag(table, base) {
+      function initTableDrag (table, base) {
         if (table.length) {
           // Create the new tableDrag instance. Save in the Drupal variable
           // to allow other scripts access to the object.
@@ -939,7 +939,7 @@
     // :even and :odd are reversed because jQuery counts from 0 and
     // we count from 1, so we're out of sync.
     // Match immediate children of the parent element to allow nesting.
-    $(this.table).find('> tbody > tr.draggable:visible, > tr.draggable:visible')
+    $(this.table).find('> tbody > tr.draggable, > tr.draggable').filter(':visible')
       .removeClass('odd even')
       .filter(':odd').addClass('even').end()
       .filter(':even').addClass('odd');
@@ -1009,7 +1009,7 @@
     var rows = [];
     var child = 0;
 
-    function rowIndentation(el, indentNum) {
+    function rowIndentation (el, indentNum) {
       var self = $(el);
       if (child === 1 && (indentNum === parentIndentation)) {
         self.addClass('tree-child-first');
diff --git a/core/misc/tableresponsive.js b/core/misc/tableresponsive.js
index b4eab62..b7167d7 100644
--- a/core/misc/tableresponsive.js
+++ b/core/misc/tableresponsive.js
@@ -27,7 +27,7 @@
    * break layouts, but it provides the user with a means to access data, which
    * is a guiding principle of responsive design.
    */
-  function TableResponsive(table) {
+  function TableResponsive (table) {
     this.table = table;
     this.$table = $(table);
     this.showText = Drupal.t('Show all columns');
@@ -64,7 +64,7 @@
   $.extend(TableResponsive.prototype, {
     eventhandlerEvaluateColumnVisibility: function (e) {
       var pegged = parseInt(this.$link.data('pegged'), 10);
-      var hiddenLength = this.$headers.filter('.priority-medium:hidden, .priority-low:hidden').length;
+      var hiddenLength = this.$headers.filter('.priority-medium, .priority-low').filter(':hidden').length;
       // If the table has hidden columns, associate an action link with the table
       // to show the columns.
       if (hiddenLength > 0) {
@@ -82,7 +82,7 @@
     eventhandlerToggleColumns: function (e) {
       e.preventDefault();
       var self = this;
-      var $hiddenHeaders = this.$headers.filter('.priority-medium:hidden, .priority-low:hidden');
+      var $hiddenHeaders = this.$headers.filter('.priority-medium, .priority-low').filter(':hidden');
       this.$revealedCells = this.$revealedCells || $();
       // Reveal hidden columns.
       if ($hiddenHeaders.length > 0) {
diff --git a/core/misc/tableselect.js b/core/misc/tableselect.js
index 78e8c90..c99e5aa 100644
--- a/core/misc/tableselect.js
+++ b/core/misc/tableselect.js
@@ -44,7 +44,7 @@
     });
 
     // For each of the checkboxes within the table that are not disabled.
-    checkboxes = $table.find('td input[type="checkbox"]:enabled').on('click', function (e) {
+    checkboxes = $table.find('td input[type="checkbox"]').filter(':enabled').on('click', function (e) {
       // Either add or remove the selected class based on the state of the check all checkbox.
       $(this).closest('tr').toggleClass('selected', this.checked);
 
diff --git a/core/misc/vertical-tabs.js b/core/misc/vertical-tabs.js
index 1b51850..fea5344 100644
--- a/core/misc/vertical-tabs.js
+++ b/core/misc/vertical-tabs.js
@@ -22,7 +22,7 @@
 
       $(context).find('[data-vertical-tabs-panes]').once('vertical-tabs').each(function () {
         var $this = $(this).addClass('vertical-tabs__panes');
-        var focusID = $this.find(':hidden.vertical-tabs__active-tab').val();
+        var focusID = $this.find('.vertical-tabs-active-tab').filter(':hidden').val();
         var tab_focus;
 
         // Check if there are some details that can be converted to vertical-tabs
@@ -119,7 +119,7 @@
      */
     focus: function () {
       this.details
-        .siblings('.vertical-tabs__pane')
+        .siblings('.vertical-tabs-active-tab').filter(':hidden')
         .each(function () {
           var tab = $(this).data('verticalTab');
           tab.details.hide();
diff --git a/core/modules/block/js/block.admin.js b/core/modules/block/js/block.admin.js
index b8f9682..3d8080a 100644
--- a/core/modules/block/js/block.admin.js
+++ b/core/modules/block/js/block.admin.js
@@ -19,21 +19,21 @@
       /**
        * Hides the <details> element for a category if it has no visible blocks.
        */
-      function hideCategoryDetails(index, element) {
+      function hideCategoryDetails (index, element) {
         var $catDetails = $(element);
-        $catDetails.toggle($catDetails.find('li:visible').length > 0);
+        $details.toggle($details.find('li').filter(':visible').length > 0);
       }
 
       /**
        * Filters the block list.
        */
-      function filterBlockList(e) {
+      function filterBlockList (e) {
         var query = $(e.target).val().toLowerCase();
 
         /**
          * Shows or hides the block entry based on the query.
          */
-        function showBlockEntry(index, block) {
+        function showBlockEntry (index, block) {
           var $block = $(block);
           var $sources = $block.find('.block-filter-text-source');
           var textMatch = $sources.text().toLowerCase().indexOf(query) !== -1;
diff --git a/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js b/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js
index 44072df..9b0aba8 100644
--- a/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js
+++ b/core/modules/ckeditor/js/ckeditor.drupalimage.admin.js
@@ -13,7 +13,7 @@
         var $maxFileSize = $(root + '[max_size]"]');
         var $maxWidth = $(root + '[max_dimensions][width]"]');
         var $maxHeight = $(root + '[max_dimensions][height]"]');
-        var $scheme = $(root + '[scheme]"]:checked');
+        var $scheme = $(root + '[scheme]"]').filter(':checked');
 
         var maxFileSize = $maxFileSize.val() ? $maxFileSize.val() : $maxFileSize.attr('placeholder');
         var maxDimensions = ($maxWidth.val() && $maxHeight.val()) ? '(' + $maxWidth.val() + 'x' + $maxHeight.val() + ')' : '';
diff --git a/core/modules/comment/comment-entity-form.js b/core/modules/comment/comment-entity-form.js
index b41ab84..f6733d0 100644
--- a/core/modules/comment/comment-entity-form.js
+++ b/core/modules/comment/comment-entity-form.js
@@ -11,7 +11,7 @@
     attach: function (context) {
       var $context = $(context);
       $context.find('fieldset.comment-entity-settings-form').drupalSetSummary(function (context) {
-        return Drupal.checkPlain($(context).find('.form-item-comment input:checked').next('label').text());
+        return Drupal.checkPlain($(context).find('.form-item-comment input').filter(':checked').next('label').text());
       });
     }
   };
diff --git a/core/modules/menu_ui/menu_ui.admin.js b/core/modules/menu_ui/menu_ui.admin.js
index 06a9f34..19e9ade 100644
--- a/core/modules/menu_ui/menu_ui.admin.js
+++ b/core/modules/menu_ui/menu_ui.admin.js
@@ -23,7 +23,7 @@
     var $menu = $('#edit-menu');
     var values = [];
 
-    $menu.find('input:checked').each(function () {
+    $menu.find('input').filter(':checked').each(function () {
       // Get the names of all checked menus.
       values.push(Drupal.checkPlain($.trim($(this).val())));
     });
diff --git a/core/modules/node/content_types.js b/core/modules/node/content_types.js
index c77a2c3..5a54d52 100644
--- a/core/modules/node/content_types.js
+++ b/core/modules/node/content_types.js
@@ -18,7 +18,7 @@
       });
       $context.find('#edit-workflow').drupalSetSummary(function (context) {
         var vals = [];
-        $(context).find("input[name^='options']:checked").parent().each(function () {
+        $(context).find("input[name^='options']")filter(':checked').parent().each(function () {
           vals.push(Drupal.checkPlain($(this).text()));
         });
         if (!$(context).find('#edit-options-status').is(':checked')) {
@@ -29,9 +29,9 @@
       $('#edit-language', context).drupalSetSummary(function (context) {
         var vals = [];
 
-        vals.push($(".form-item-language-configuration-langcode select option:selected", context).text());
+        vals.push($(".form-item-language-configuration-langcode select option", context).filter(':selected').text());
 
-        $('input:checked', context).next('label').each(function () {
+        $('input', context).filter(':checked').next('label').each(function () {
           vals.push(Drupal.checkPlain($(this).text()));
         });
 
@@ -40,7 +40,7 @@
       $context.find('#edit-display').drupalSetSummary(function (context) {
         var vals = [];
         var $editContext = $(context);
-        $editContext.find('input:checked').next('label').each(function () {
+        $editContext.find('input').filter(':checked').next('label').each(function () {
           vals.push(Drupal.checkPlain($(this).text()));
         });
         if (!$editContext.find('#edit-display-submitted').is(':checked')) {
diff --git a/core/modules/node/node.js b/core/modules/node/node.js
index cf0f979..7a57112 100644
--- a/core/modules/node/node.js
+++ b/core/modules/node/node.js
@@ -39,7 +39,7 @@
         var vals = [];
 
         if ($optionsContext.find('input').is(':checked')) {
-          $optionsContext.find('input:checked').next('label').each(function () {
+          $optionsContext.find('input').filter(':checked').parent().each(function () {
             vals.push(Drupal.checkPlain($.trim($(this).text())));
           });
           return vals.join(', ');
diff --git a/core/modules/system/system.modules.js b/core/modules/system/system.modules.js
index 45ddf3b..38ef180 100644
--- a/core/modules/system/system.modules.js
+++ b/core/modules/system/system.modules.js
@@ -21,16 +21,16 @@
       var $details;
       var searching = false;
 
-      function hidePackageDetails(index, element) {
+      function hidePackageDetails (index, element) {
         var $packDetails = $(element);
-        var $visibleRows = $packDetails.find('table:not(.sticky-header)').find('tbody tr:visible');
+        var $visibleRows = $packDetails.find('table:not(.sticky-header)').find('tbody tr').filter(':visible');
         $packDetails.toggle($visibleRows.length > 0);
       }
 
-      function filterModuleList(e) {
+      function filterModuleList (e) {
         var query = $(e.target).val().toLowerCase();
 
-        function showModuleRow(index, row) {
+        function showModuleRow (index, row) {
           var $row = $(row);
           var $sources = $row.find('.table-filter-text-source');
           var textMatch = $sources.text().toLowerCase().indexOf(query) !== -1;
diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js
index d0534cf..ae88dcf 100644
--- a/core/modules/views_ui/js/views-admin.js
+++ b/core/modules/views_ui/js/views-admin.js
@@ -713,7 +713,7 @@
           // first operator dropdown we encounter, going backwards from the current
           // row. This dropdown is the one associated with the current row's filter
           // group.
-          var operatorValue = $draggableRow.prevAll('.views-group-title').find('option:selected').html();
+          var operatorValue = $draggableRow.prevAll('.views-group-title').find('option').filter(':selected').html();
           var operatorLabel = '<span class="views-operator-label">' + operatorValue + '</span>';
           // If the next visible row after this one is a draggable filter row,
           // display the operator label next to the current row. (Checking for
@@ -834,7 +834,7 @@
    */
   Drupal.behaviors.viewsUiChangeDefaultWidget = {
     attach: function () {
-      function changeDefaultWidget(event) {
+      function changeDefaultWidget (event) {
         if ($(event.target).prop('checked')) {
           $('input.default-radios').hide();
           $('td.any-default-radios-row').parent().hide();
