0

I'm trying to enable bootstrap buttons for all submit buttons using the code below. However, it doesn't work. What is wrong?

<script src="http://code.jquery.com/jquery-latest.js"></script>
<script src="/inc/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$('button, input:submit, input:button').button()
});
</script>

Thanks!

3
  • 1
    did u load the bootstrap css?? Commented Nov 6, 2012 at 11:33
  • Yes, adding the class 'btn' works fine. However unfortunately it isn't possible to add the class to all submit buttons. Commented Nov 6, 2012 at 11:36
  • Did you verify whether your jQuery selector is returning all the elements? Commented Nov 6, 2012 at 12:40

1 Answer 1

1
<script type="text/javascript">
    $(document).ready(function() {
        $('input[type="submit"], input[type="button"]').addClass('btn');
    });
</script>
Sign up to request clarification or add additional context in comments.

1 Comment

$('input[type="submit"], input[type="button"], input[type="reset"], button')

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.