RichieHindle
2009-07-05 11:48:05
+1 didn't know about that unary plus operator
Andreas Grech
2009-07-05 12:48:27
+3
A:
The difference is in CSS selectors in general, not jQuery specifically. "#orderedlist li" will select any LI element below the #orderedlist element in the tree. "#orderedlist>li" will only select the LI if it is a direct child of #orderedlist.
The + operator is just a common shortcut for converting a string to a number in JavaScript. E.g., +"1" + 1 will return 2, not 11.
Not sure about this offhand without seeing the example that doesn't work.
James M.
2009-07-05 11:53:20