js代码
<script type="text/javascript" src="js/jquery-1.11.0.min.js"></script> <script type="text/javascript" src="js/jquery.input-counter.min.js"></script> <script type="text/javascript"> var options = { selectors: { addButtonSelector: '.btn-add', subtractButtonSelector: '.btn-subtract', inputSelector: '.counter', }, settings: { checkValue: true, isReadOnly: true, }, }; $(".input-counter").inputCounter(options); </script>