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

  • SEARCH
  • Home
  • 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 6662787
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:25:40+00:00 2026-05-26T02:25:40+00:00

Please find the below structure. When i click a button i need to get

  • 0

Please find the below structure.

When i click a button i need to get the li value of two div.

For example, Let us consider in first div i have selected test2 and in second div i have selected test 8 and when i click the button i need to get the value as 558 and 561

How can i do this using jquery.

<div class='parent'>test 1</div>
<div class="list">
    <ul>
    <li value="0">All</li>
    <li value="556">test 1</li>
    <li value="558">test 2</li>
    <li value="560">test 3</li>
    <li value="561">test 4</li>
    </ul>  
</div>

<div class='parent2'>test 6</div>
<div class="list2">
<ul>
<li value="0">All</li>
<li value="556">test 5</li>
<li value="558">test 6</li>
<li value="560">test 7</li>
<li value="561">test 8</li>
</ul>  
</div>

Thanks in advance…

  • 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-05-26T02:25:41+00:00Added an answer on May 26, 2026 at 2:25 am

    li tags cannot be selected and do not have a value attribute defined. It would be more correct to use radio buttons or a dropdown to select a value. If you want to use li you could keep 2 global variables with the corresponding selected values which will be updated everytime some li is clicked:

    var value1 = '0',
        value2 = '0';
    
    $('.list li').click(function() {
        value1 = $(this).attr('value');
    });
    
    $('.list2 li').click(function() {
        value2 = $(this).attr('value');
    });
    
    $('#someButton').click(function() {
        alert('value1 = ' + value1 + ' | value2 = ' + value2);    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please find the below code <?xml version=1.0 encoding=utf-8?> <mx:Application xmlns:mx=http://www.adobe.com/2006/mxml layout=absolute> <mx:Script> <![CDATA[ [Bindable]
Please find below the piece of code that I use to tokenize a string.
Please find the below code i tried to add toolbar into the uipicker but
I am facing problems with Refinement Panel in SharePoint 2010 . Please find below
I am using DB4O to store my objects. Please find below code to retrieve
Please find xml data below. I would like to obtain nodes with keys Sub1
Please find below my code. Employee class implements IEmployee interface. namespace MiddleWare.ServiceContracts { [ServiceContract(Namespace
Please find below my ActionResult Index: public ActionResult Index(string SectionText) { var products =
Could you please help me find out the time complexity of the Fleury' algorithm
ereg and eregi functions will be deleted from Php. Please help to find alternatives

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.