'from jquery to javascript autoscroll

Can someone tell me what this code would look like if it was written only using vanilla javascript? I'm using some snippets to "convert" but it doesn't seem to work, thanks to anyone who makes it available

$(".toggle").on("click", function () {
    $(".container").toggleClass("microsoft");
});


Solution 1:[1]

let toggle = document.getElementsByClassName('toggle');

toggle.addEventListener('click', function() {
    let container = document.getElementsByClassName('container');
    container.classList.toggle('microsoft');
});

    

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1