Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
// All paragraphs, then filter to those with class "highlight" var $highlighted = $('p').filter('.highlight'); // Exclude disabled inputs $('input').not(':disabled').val(''); // Keep list items that contain a link $('li').has('a').addClass('has-link'); // Test if a selection matches (returns boolean) if ($('#form').is(':visible')) { console.log('Form is visible'); } // Index-based $('tr').first().addClass('table-head'); $('tr').last().addClass('table-foot'); $('tr').eq(2).addClass('third-row'); // zero-based
Result
Open