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?
First of all, this is working solution:
And I have some advices;
.sequencefor selector, you have to use[name='sequence']or you can give itsequenceclass and use it.sequencedataproperties and.data(), use it likedata-art-no="27"and access it like.data('art-no')event.preventDefault()insted ofreturn false.Here is your revised code: