Jquery html usdating existing javascript function