Using jQuery in a template (phtml) (Magento 2)

The following code shows how to load and use jQuery in a Magento 2 .phtml template.

Activate JavaScript console for Firefox (Magento 1)

For whatever reason, the JavaScript console is not working for Magento by default. So if you try to output messages using console.log, nothing will happen. To change that, open js\varien\js.js and uncomment the following code: