Add class to Bootstrap login form button I want to add a class to a button in my login form. I have searched through all the template files and I cannot find where to do this. I found the following code that best matches the form in modules/user/user.module

function user_login_block($form) {
$form['#action'] = url(current_path(), array('query' =&gt; drupal_get_destination(), 'external' =&gt; FALSE));
$form['#id'] = 'user-login-form';
$form['#validate'] = user_login_default_validators();
$form['#submit'][] = 'user_login_submit';


The HTML for the button is below. My aim is to change btn-default to btn-primary

&lt;button class="btn btn-default form-submit" id="edit-submit" name="op" value="Log in" type="submit"&gt;Log in&lt;/button&gt;


Please help!
Checkout hook_form_alter. You can add and change (I would suggest only adding unless you are sure it will only affect the forms you want it to) classes with #attributes