I'm trying to install a jQuery plugin for input masking. I've included the js file fine, and I try to initialize it per the docs:
<script src="autoNumeric.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function(){
$('#balance-input').keyup(function(){
$('.stripe-button').attr('data-amount', $('#balance-input').val());
});
$('#balance-input').autoNumeric('init');
});
</script>
The first keyup function works fine and is unrelated to the second function. In the console, I get an error that autoNumeric is undefined. Then I enter $('#balance-input').autoNumeric('init'); into the console and it works without a problem. It's inside document.ready and the plugin is included prior to the document.ready. What to do?