Jquery .val() quetion

Hello forums how do I get the value of a submit button in Jquery using the val() function:

I have a form

<form id=“myForm” action=“blahblah” method=“blahblah”>

<!-- input checkboxes here –>

<input type=“image” src=“myImage1” class=“del” name=“submit” value=“delete” />
<input type=“image” src=“myImage2” class=“del” name=“submit” value=“restore” />
<input type=“image” src=“myImage3” class=“del” name=“submit” value=“empty” />

$(document).ready(function() {
$('#myForm').submit(function() {
 var value = $('input.del').val(); 
    return false;


I have this script but it only returns “delete” when I click either the “restore” and “empty” it still returns “delete”. I’m pretty sure I missed a jQuery Voodoo here . Please help . stuck for hours


googleing for answers I found that I should use the attributes instead of the values :

 $(document).ready(function() {
        $('.del').click(function() {