Similarly, you will see later on us using
a statement like saying dollar, and
then within quotation marks, #mycarousel,
implying that you are specifying the ID of a specific HTML element,
and then specifying carousel and pause.
We'll look at more details of what this actually does
in one of the subsequent slides there.
But note the structure of the jQuery statement syntax there.
You specify the selector, and then you specify the corresponding action to be
performed on the element that is selected by these selectors.
Let's take a look at Bootstrap jQuery example.
We'll go back to the previous example that we have seen earlier,
where we introduce the tooltip.
So, when we introduce the tooltip, we specified script and
then inside the script, we said $(document).
In this case the document means the entire document.
So the selected here is for the entire document.
So for the entire document, and then we'll specify ready.
Ready is the action to be taken.
So when the document is ready, then execute this function that is
specified as a parameter for this ready action there.
So the function that we saw being used for the tooltip specified it as $, and
then within brackets, it said, data-toggle=" tooltip".
Now here we are specifying that select those elements for
which there is an attribute with data-toggle="tooltip".
And then for those elements that match this criteria,perform this action
called enable tooltips for those elements.
And we close the function there.
So this specifies that this particular script will
be activated for those elements for which you have applied the data-toggle tooltip.
So basically for those HTML elements on which you have defined tooltips,
you want the tooltip to be enabled there.
So this is how we interpret this syntax of this jQuery example here.
Let's look at the various ways of specifying selectors.
So as we realize from the jQuery statement syntax,
we always follow dollar and then, within brackets, we specify a selector.
How do we specify selectors, what are the various ways you can specify selectors?
Here are some possibilities.
You can specify a selector by specifying any specific
HTML element by specifying the tag.
So you can say p, button, h4,
h3, or any of the HTML tags directly.
And so in that case the HTML tag name is specified within quotes and
that'll form your selector.
When you apply a selector like this, you're saying all the elements that match
this criteria will be selected.