0

After searching for hours I finally found how to even edit a element with TamperMonkey but whenever I run that script only the first line works please see the script and help.

document.getElementsByClassName("loginPanelTitle")[0]
.style.display="flex"; //works
.style.opacity="0.5"; //doesn't work
.style.align-items="center"; //doesn't work
.style.padding="4px 8px"; //doesn't work
.style.font-size="24px"; //doesn't work
.style.background-color="#000000"; //doesn't work
.style.border-radius="2px 2px 0 0"; //doesn't work
.style.border-bottom="1px solid #d3d3d3"; //doesn't work

})();

1 Answers1

1

Use a variable to store the element reference

var element = document.getElementsByClassName("loginPanelTitle")[0];
element.style.display="flex";
element.style.opacity="0.5";
// etc

Edit: You'll also need to use brackets for border-radius and others that use a dash, or use the camelCase variant of them

element.style["border-radius] = "2px 2px 0 0";

or

element.style.borderRadius = "2px 2px 0 0";