Script Manager Explanation or example

Can somebody explain me in what form add javascript snippet. I have tried with/without script tag, with/without window.onload = function(). No success.
I'm not really a coder. I just want to add some class to element with classname, something like
var v = document.getElementsByClassName("class 1");
v.className += "class 2";
I have undestood that it doesn't work with jquery. Only javascript.
BTW I'm working with Drupal 9. Perhaps it's the problem

Comments

jeanpaulbouvet created an issue.

jeanpaulbouvet’s picture

I've tried with D8 and it works. It seems to be a problem with D9. Is there a patch for working or a Release with D9?