$(function(){  divFun(); }); function divFun(){ var h=$('div').height(); alert(h) }