I'm using code like $('.elem',elem)
, $('.elem',elem).tabs()
.
$(".elem")
is used to select elements with that class.
But what is the next after comma? What is the use of it?
“Next” is one of those tricky words! Do you need a comma after “next” in a sentence? You need a comma after “next” when it is used as an introductory word/phrase at the start of a sentence/clause. Used in this way, “next” is an adverb. “Next” as an adverb may also occur later in the sentence when the sentence contains a compound direct object.
A comma normally follows participial phrases that introduce a sentence: Grabbing her umbrella, Kate raced out of the house. Confused by her sister’s sudden change in mood, Jill stayed quiet. When an adverbial phrase begins a sentence, it’s often followed by a comma but it doesn’t have to be, especially if it’s short.
If you introduce a sentence with a transition word (e.g. however, hence , indeed, furthermore ), follow it with a comma. However the model is not always accurate. However, the model is not always accurate.
When an introductory prepositional phrase is very short (less than four words), the comma is usually optional. But if the phrase is longer than four words, use a comma. Consider the below examples of sentences containing properly placed and omitted commas: Before the movie let’s get some popcorn.
$('.elem',elem)
is $(elem).find('.elem')
. In fact, that's what jQuery does with it under the covers. It finds all elements with class "elem"
that are descendants of the elem
element.
This is covered in the API documentation. It's well worth spending an hour just reading that from beginning to end. There are all sorts of useful things in there that aren't well known. :-) (I'm not saying this is one of them [I'm not a fan of it myself, some folks are], just that generally there are lots of useful things in there.)
This is the context into which the search is done.
It's the same than
$(elem).find('.elem')
See documentation here
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With