How to Get Variant ID on Change of the variations options/combination

Hey Folks,

I am trying to get variation ID using Javascript/jQuery on selection of different combination or options. I have found few posts which suggests to set a callback function onVariantChange. I am trying to add the following code to product.liquid

{{ 'option_selection.js' | shopify_asset_url | script_tag }}

So initially this through jQuery not defined error. Later on I have added jQuery URL to theme.liquid header section. After that it gives other error.

I’ll be glad if someone can help with this.