In jQuery, what does "find('> span')" do? -
i don't understand find('> span')
does.
could please explain it?
html code
<button>ibis<span class="bg"><span>ibis</span></span></button>
jquery code
$(this).find('> span').animate( { width: '100%' } );
$(this).find('> span')
finds span immediate child of this
in example, finds <span class="bg">
, not <span>
within <span class="bg">
jquery selectors work css selectors. writing button > span
in css. gives immediate child span only. without >
, writing button span
in css, effect spans within <button>
hth :) , welcome stackoverflow
Comments
Post a Comment