$(".info").click(function(e) {
//just in case, will be useful if your href is anything other than #
e.preventDefault();
alert($(this).prev('input[type="hidden"]').val());
});
prev method will search for the previous element, which is where your input[hidden] is.
And its href, not hre, in the <a/> tags.
Solution 2:
You can also use attributes <a href="#" data-hidden="1" class="info"> don't need use hidden fields
$(".info").click(function(e) {
e.preventDefault();
alert($(this).data('hidden')); // or $(this).attr('data-hidden');
});
Share
Post a Comment
for "JQuery Get Value From Hidden Input In Column"
Post a Comment for "JQuery Get Value From Hidden Input In Column"