Creating javascript function to prepare for new feature