How to remove class in all input field inside a form - jquery
<p>While i click the submit button the form will look like below with error messages:</p>

<p><strong>My Problem is when i click on clear link i need to <code>remove the error class in input fields</code> and clear the values in <code>messages-inline</code> class.</strong></p>

<p><strong>How can i do that using jquery.</strong></p>

<p><strong>Note</strong>: there may be many fields such like password, confirm password etc... So the concept should be dynamic.</p>

<pre><code>&lt;form id="user-login" method="post" accept-charset="UTF-8" action="/user/register?destination=node%2F1" novalidate="novalidate"&gt;
    &lt;div id="edit-name-wrapper" class="form-item"&gt;
        &lt;label for="edit-name"&gt;
            &lt;span title="This field is required." class="form-required"&gt;*&lt;/span&gt;
            E-mail: 
        &lt;/label&gt;
        &lt;input type="text" class="form-text required error" tabindex="1" value="" size="60" id="edit-name" name="name" maxlength="60"&gt;
    &lt;/div&gt;    
    &lt;div class="messages error messages-inline"&gt;E-mail field is required.&lt;/div&gt;

    &lt;input type="submit" class="form-submit" tabindex="4" value="Log in" id="edit-submit" name="op"&gt;
    &lt;/div&gt;
&lt;/form&gt;
</code></pre>
