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 6150621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T19:38:25+00:00 2026-05-23T19:38:25+00:00

I have an unordered list of form elements with ids <ul class=sortable id=userForm> <li

  • 0

I have an unordered list of form elements with ids

 <ul class="sortable" id="userForm">
<li style="visibility: hidden;" class="ui-state-default">Test</li>
<li style="display: list-item;" class="ui-state-default">
<div class="control">
  <label class="">Label Here</label>
  <textarea readonly="readonly" id="4"></textarea>
  <div class="delete" style="display: inline;"><sup>x</sup></div>
  <div class="properties txtarea" style="display: inline;">Properties</div>
</div>
</li>
<li style="display: list-item;" class="ui-state-default ">
<div class="control">
  <label class="">Label Here</label>
  <input readonly="readonly" id="3" name="txt" value="" type="text">
  <div class="delete" style="display: inline;"><sup>x</sup></div>
  <div class="properties txtbox" style="display: inline;">Properties</div>
</div>
  </li>
  <li style="display: list-item;" class="ui-state-default">
<div class="control">
  <label>&nbsp;</label>
  <input id="2" type="radio">
  <span class="controlText">Radio Button</span>
  <div class="delete" style="display: inline;"><sup>x</sup></div>
  <div class="properties radio" style="display: inline;">Properties</div>
</div>
 </li>
<li style="display: list-item;" class="ui-state-default">
<div class="control">
  <label>&nbsp;</label>
  <input id="1" type="checkbox">
  <span class="controlText">Check Box</span>
  <div class="delete" style="display: inline;"><sup>x</sup></div>
  <div class="properties chkbox" style="display: inline;">Properties</div>
</div>
</li>
</ul>

How can i get the Maximum id from these elements. The Ids are not in a particular order but the element classes and format is same.

  • 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-23T19:38:25+00:00Added an answer on May 23, 2026 at 7:38 pm

    Something like this could work

    var max = 0;
    $('.control').each(function(i,n){
     // var check = $(n).children('input').attr('id')/*.prop() if jquery 1.6*/
      var check = $(n).children('.the_id').attr('id')/*.prop() if jquery 1.6*/
      if(check>max) max = check;
    });
    

    Here is a jsfidle version

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

Sidebar

Related Questions

I have a unordered list: <ul id=sortable> <li id=1 class=ui-state-default>First <a href='#' title='delete' class=itemDelete>x</a></li>
I have an unordered list with elements and I want to append an item
I have an unordered list. <style> #button1 { position:relative; z-index: 3; } #button2 {
I have an unordered list with a few list elements. #tags { width: 300px;
I have a simple ASP.Net form with the following unordered list: <ul id=ctl00_ContentPlaceHolder1_BulletedList1> <li>No
I have an unordered list like so: <ul class=foo> <li id=asdf> <span class=indexnumber></span> <span
I have a unordered list that contains <ul id=strip> <li><a href=#><span>This-is a test string</span></a></li>
I have an unordered list like this: <div class=blueBoxMid> <ul> <li>First item <em>This is
I have this unordered list <ul> <li>two</li> <li>three</li> </ul> Is there a way I
I have an unordered list <ul id=List1> <li>www.xyz.com</li> <li>www.abc.com</li> </ul> using jquery, I want

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.