Skip to content

Jquery selection

Sébastien LUCAS edited this page Aug 7, 2013 · 9 revisions
  • Select several DOM element that are not of the same type
    This code select html but also body
    $('html, body');

  • eq Return a given sub object by its index n°
    http://api.jquery.com/eq/

$('li').eq(2); // The third li
var previous = $(this).prev('td');   
var next = $(this).next('td');   
var all = $.merge(previous, next);   

WIKI by Sébastien Lucas CEO & Funder or Bricks

Clone this wiki locally