Maybe someone else knows more, but since dae posted this here not long ago: JQuery seems to be broken after V3 updates to website.
I guess JQuery won’t really work, unless you load it externally. dae also shows in the linked post, what you could do if you really have to rely onto jquery.
Maybe try vanilla JavaScript if this won’t work either?