How to judge whether selected result is empty or not with jQuery?

omg picture omg · Aug 27, 2009 · Viewed 10.8k times · Source
$("#experiences tr")

For the above one,how to judge if it's empty or not?

I thought its boolean value should be false,but seems not.

Answer

mck89 picture mck89 · Aug 27, 2009

use the length property:

$("#experiences tr").length

if it's 0 it's empty