I'm pretty new to jQuery, and I have the following function:
$('#new-game').click( evt => {
evt.preventDefault();
console.log("HELP ME");
alert('button');
startGame();
});
This function works when I copy it into the Google inspector console, but nothing happens when I click the button without first adding the function to the console.
<!-- jQuery ---------------------------------->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script src="http://code.jquery.com/ui/1.9.2/jquery-ui.js"></script>
<!-- JS ----------------------------->
<script src="/js/grammarian.js"></script>
As you can see, my js file is after my jQuery, so I'm not sure why this is happening.