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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:15:04+00:00 2026-06-10T04:15:04+00:00

Using jquery to find out the value on a clicked event. Each time the

  • 0

Using jquery to find out the value on a clicked event. Each time the delete class is clicked the hiddenvariable returns the first hdid instead of the clicked hdid. When I use the this it returns the entire delete class but I only need the ‘hdid’ of the select class. The question is how can I use this to set the variable to the selected hdid

<form id="frmDelete" method="post" action="delete-class.php">
            <ul id="class">
                <li>
                    <div class="delete">ED 123-123<input type="hidden" name="hdid" id="hdid" value="6"/></div>
                </li>
                <li>
                    <div class="delete">EDU 121-101<input type="hidden" name="hdid" id="hdid" value="7"/></div>
                </li>
                <li>
                    <div class="delete">STU 120-456<input type="hidden" name="hdid" id="hdid" value="8"/></div>
                </li>               
            </ul>
        </form>
    </div>
    <script>
        $(function() {
            $(".delete").click(function() {
                var hidden = $('#hdid').val();
                console.log(hidden);
                console.log(this);
            });
        });
    </script>
  • 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-10T04:15:06+00:00Added an answer on June 10, 2026 at 4:15 am
    $(function() {
            $(".delete").click(function() {
                var hidden = $(this).find("hidden").val();
                console.log(hidden);
            });
        });
    

    And id should be unique

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

Sidebar

Related Questions

Using jquery how do I find out the target value of a href link.
How to find out form element type by its name using jQuery. For example
I'm using jquery's $.get() to find out how many entries are in a table.
I'm using JQuery to find certain div classes within DOM & If they found
I have an unordered list, and am using jquery to find the last ul
Possible Duplicate: Find text string using jQuery? How do you find a text string
I am using jquery and I would like to find the src of the
I am using jQuery Accordion here and find some strange behavior when opening a
How can I find the current page number in jqGrid (using jQuery of course).
I am trying to find and replace html data using jquery. The jquery script

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.