javascript function to check string contains