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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T10:43:59+00:00 2026-06-15T10:43:59+00:00

When I click on the Delete Button, how can I get the value of

  • 0

When I click on the Delete Button, how can I get the value of art-no in jquery?

<form id="artForm" method="post">
<input type="hidden" name="sequence" value="27" art-no="27">
<input type="button" value="Delete" class="delete" id="submitbutton">
</form>

In using jQuery like this:

$(".delete").click(function() {
alert (".sequence").attr("art-no");
return false;
});

This should actually have worked, but I keep getting .sequence in the alert box. Is it because it’s hidden?

  • 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-15T10:44:00+00:00Added an answer on June 15, 2026 at 10:44 am

    First of all, this is working solution:

    $(".delete").click(function() {
        alert ($("[name='sequence']").attr("art-no"));
        return false;
    });
    

    And I have some advices;

    • That hidden field has no class name, so you can’t use .sequence for selector, you have to use [name='sequence'] or you can give it sequence class and use it .sequence
    • Instead of making up your own properties you can use data properties and .data(), use it like data-art-no="27" and access it like .data('art-no')
    • Last, use event.preventDefault() insted of return false.

    Here is your revised code:

    $(".delete").click(function(e) {
        e.preventDefault();
        alert ($("[name='sequence']").data("art-no"));
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

$(#button_title_delete).click(function(){ jQuery.ajax({type:'POST', url:'delete.php', data: 'id='+$(bid).val(), success: function(veri) { $(#delete_result).html(veri);} }); }); When i click
$(input[name='add'].my).click(function(){ //i tried use this <input type=button name=add value=..../> //element to find his parent's
I have a delete button on a table and a jquery on click eventlistener
I have one Input.hidden in a foreach , how can I get the different
As soon as the user clicks the delete button my jQuery script asks the
<script type=text/javascript> $(document).ready(function($) { $(a.delete).click{function(){ $(this).parent().remove(); } }); </script> <li> <a href=index.html> <h3>1</h3> </a>
How can I rewrite this code to coffeescript: $('.delete_action').click(function(event) { $.get('/delete_action?name=' + event.target.name +
The idea is user can click a button Add Country, Country picker will come
I am triggering jqgrid reload on button click and also resetting the page value
My delete command isn't deleting. When I click the delete button, I see the

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.