How can I select item with class within a DIV?
Try:
$('#mydiv').find('.myclass');
Or:
$('.myclass','#mydiv');
Or:
$('#mydiv .myclass');
References:
Good to learn from the find()
documentation:
The .find() and .children() methods are similar, except that the latter only travels a single level down the DOM tree.
You'll do it the same way you would apply a css selector.For instanse you can do
$("#mydiv > .myclass")
or
$("#mydiv .myclass")
The last one will match every myclass inside myDiv, including myclass inside myclass.