I have this code:
<script>
$(function () {
function back_to_top(){
$('body,html').animate({scrollTop: 0}, 100);
}
});
</script>
<div class="toTop" onClick="back_to_top();">To up!</div>
When I click to this button, chrome show me this error: Uncaught ReferenceError: back_to_top is not defined. Where is my mistake?