So I'm reviewing the code of a website my friend coded, and I wanted to know if there is a way that I can change all elements with a specific class name, to another using Tampermonkey.
Here's my code at the moment:
// @name ClassName Change
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Change class names for website review
// @author Me
// @match https://example.com/*
// @grant none
// @include https://example.com/*
// ==/UserScript==
const change = document.getElementsByClassName("svg-sprite-vs top-point-empty");
change.className = "svg-sprite-vs top-point-full";
The "tampermonkey script running" badge shows up in the toolbar meaning that the script is running, but the class names aren't changing and the way the website looks doesn't change either.
Any suggestions?