I have the following HTML:
<div id="mydiv"><div class="myclass"></div></div>
I want to be able to use a selector that selects the inside div, but specific for the "mydiv" container. How can I achieve this with JQuery?
I have the following HTML:
<div id="mydiv"><div class="myclass"></div></div>
I want to be able to use a selector that selects the inside div, but specific for the "mydiv" container. How can I achieve this with JQuery?
try this instead
$(".video-divs.focused")
. This works if you are looking for video-divs that are focused.More efficient and faster one is...
You'll do it the same way you would apply a css selector. For instanse you can do
or
The last one will match every myclass inside myDiv, including myclass inside myclass.
Try this
Try:
JS Fiddle demo.
Or:
JS Fiddle demo.
Or:
JS Fiddle demo.
References:
find()
.If you want to select every element that has class attribute "myclass" use
If you want to select only div elements that has class attribute "myclass" use
find more about jquery selectors refer these articles