简体   繁体   中英

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM