Сначала был такой код. Обратите внимание на место расположения$('#sendbutton').click(fun  ction(){alert('hohohohoho');});
$(document).ready(
	(function(){
		return myfunc;
	})()
);
function myfunc(){
	console.log('well done');
	$('#sendbutton').click(function(){alert('hohohohoho');});
}
Затем я навешивание события переместил внутрь $(document).ready() и событие перестало работать:
$(document).ready(
	(function(){
		$('#sendbutton').click(function(){alert('hohohohoho');});
		return myfunc;
	})()
);
function myfunc(){
	console.log('well done');
}
Что я не так сделал?