how to pass model value to javascript function