What\'s the easiest way to get the depth of an element in pure JavaScript or jQuery? By \"depth\" I mean how many elements deep is it nested, or how many ancestors does it h
How about:
$('#my-element').parents().length