When should I use [0] to dereference a returned selected result?

When should I use [0] to dereference a returned selected result?

Hello all,


  1. var variableA = $("#sampleID");     // case A
  2. var variableB = $("#sampleID")[0]; // case B
  3. // apply a function call to variableA or variableB (i.e. css(...))

The question is when I have to use the case B and when I can use case A without causing problems?


Thank you