jquery easyui遇到的的问题

$("#subbtn").click(function(){
$('#uname').tooltip({
position : 'right',
content : '请输入姓名',
});
$('#age').tooltip({
position : 'right',
content : '请输入年龄',
});
});
function sub(){
$('#uname').tooltip({
position : 'right',
content : '请输入姓名',
});
$('#age').tooltip({
position : 'right',
content : '请输入年龄',
});
}
为什么前一个方法没反应,添加onclick的就可以了

http://blog.csdn.net/sunwei3301/article/details/46535313