Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9014979
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:38:19+00:00 2026-06-16T03:38:19+00:00

I have sample html code: <div class=category> <div class=product> <!– some product info –>

  • 0

I have sample html code:

<div class="category">
     <div class="product">
         <!-- some product info -->
         <input type="text" value="0" /> <!-- it is quantity -->
     </div>
<!-- ... other products -->
</div>
<!-- ... other categories -->

So I need to get all categories using jQuery, where at least one product has positive quantity.

Something looks like this (in C#)

var filteredCategories = categories.Where(c => c.Products.Any(p => p.Quantity !=0));

how to do it using jQuery?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:38:20+00:00Added an answer on June 16, 2026 at 3:38 am
    $('.product', '.category').filter(function() {
        return parseint($(this).children('input[type="text"]').val(),10) !== 0;
    }).dosomething();
    

    You should consider adding a class to the quantity input to target it, as any other text inputs inside the .product element would also be selected with this method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this simple piece of HTML code: <div> <input type=file name=english-file /> </div>
I have a template like this: <script id=notesTemplate type=text/html> <li class=Note> <div class=NoteDate data-bind=style:
I have the following Code var page = '<h1>Hello!</h1><p>FOO</p><span class=username>this is ur name</span><p>sample text</p>';
I have this code in my view <a href=#SampleEditor onclick=javaScript:ShowSampleEditor() id=SampleLink>Add Sample</a> <div class=editor-field
I have a very simple HTML/JS code, which expands the size of a div
I have simple HTML code with some JavaScript. It looks like: <html> <head> <script
I have the simple JS code for updating text on button: <html> <head> <script
<p title=The test paragraph>This is a sample of some <b>HTML you might<br>have</b> in your
i have the following jquery code: $(document).ready(function() { $('.restrictiveOptions input[type!=checkbox], .restrictiveOptions select').change(function() { //
For example I have simple html. <body> <div class=a> <div class=child></div> <!-- div element

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.