Sander
Sander

Reputation: 67

How can I enable bootstrap buttons using javascript?

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!

Upvotes: 0

Views: 756

Answers (1)

Alex  Zhdanov
Alex Zhdanov

Reputation: 521

<script type="text/javascript">
    $(document).ready(function() {
        $('input[type="submit"], input[type="button"]').addClass('btn');
    });
</script>

Upvotes: 1

Related Questions