get the class of the button inside the form that has been currently clicked
<p>OK, I want to get the class of the current clicked button inside a form and i tried this and so i have this code but unfortunately, it doesnt work and instead, a alertbox popup with the "undefine" text. it should be, an alertbox will popup with the class of the current clicked button.</p>

<pre><code>$('#aholder form').submit(function(){
    var button = $(this).find("button").attr("class");
    alert(button);
    return false;
});
</code></pre>

<p>Hope someone could help and oh, I have several forms and i have those each buttons with a unique class on those each forms and i want to get the class of the current clicked button which inside of the form and so here's the html thing to be look for..</p>

<pre><code>&lt;div id="aholder"&gt;
    &lt;form id="gs" action="processor.php" method="POST"&gt;
        &lt;input type="text" name="input" value="input1" /&gt;
        &lt;button class="globalsettings"&gt;Global Settings&lt;/button&gt;
    &lt;/form&gt;
    &lt;form id="pp" action="processor.php" method="POST"&gt;
        &lt;input type="text" name="input" value="input2" /&gt;
        &lt;button class="Postapage"&gt;Post a page&lt;/button&gt;
    &lt;/form&gt;
    &lt;form id="logoff" action="processor.php" method="POST"&gt;
        &lt;input type="text" name="input" value="input3" /&gt;
        &lt;button class="Logout"&gt;Logout&lt;/button&gt;
    &lt;/form&gt;
&lt;/div&gt;
</code></pre>

<p>PS: im open in any ideas, recommendations, suggestions and anything that can be added. Thank you in advance.</p>
