What are the pros and cons of the following function scopes:
Global Function/Inline JS
<script> function funcA() { //do something } </script> <button id="buttA" onclick="funcA();">Click Me</button>
Global Function/Non-inline JS
<script> function funcA() { //do something } $(function() { $('#buttA').on('click', funcA); }); </script> <button id="buttA">Click Me</button>
Non-global Function/Non-inline JS
<script> $(function() { $('#buttA').on('click', funcA); function funcA() { //do something } }); </script> <button id="buttA">Click Me</button>
Which combination is better and why?