Also if putting a snippet in a template then also read this: https://docs.moodle.org/dev/Templates#What_if_a_template_contains_javascript.3F - where you can still use 'require' to get jQuery.
Themes
Add javascript code in theme moove
This discussion has been locked so you can no longer reply to it.