Will Web 3.0 Replace Web 2.0?
Become a member
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
C# Corner Home
Technologies
Monthly Leaders
ASK A QUESTION
Forum guidelines
Ankush
1.9k
267
53.5k
Count number of divs with same class name in a specific div in jquery
Oct 27 2020 2:02 AM
I have following divs
<
div
class
=
"Main"
>
<
div
class
=
"pipe"
>
<
div
class
=
"mine"
>
</
div
>
<
div
class
=
"mine"
>
</
div
>
<
div
class
=
"mine"
>
</
div
>
</
div
>
<
div
class
=
"pipe"
>
<
div
class
=
"mine"
>
</
div
>
<
div
class
=
"mine"
>
</
div
>
</
div
>
</
div
>
var count = $(.pipe.mine).length;
It counts all divs with class = "mine" and shows count as 5.
but I want to only count divs with class = "mine" in upper div not both the divs
Thanks in Advance!!!
Reply
Answers (
7
)
fetch a value using fieldref and pass to var in Ext js
I need the JQuery function for filtration.