Why selecting via [0] in jquery does not work with visual effects??
$("p")[0].slideUp(); /* it does not work*/
$("p").eq(0).slideUp(); /* it works */
As mentioned, I know there are some other ways to select the first p, but I am eager to know why the above mentioned code is not working…
Thanks in advance,
.slideUp()is a jQuery method and will work on a jQuery object.$("p").eq(0)produces a jQuery object which has a.slideUp()method (so it works).$("p")[0]produces a DOM object that does NOT have a .slideUp()method (so it doesn’t work).