how to pass id in javascript function