border-right
is a style property, not an element attribute, so removeAttribute
won't work. Instead try this:
document.getElementById("mainContainer").style.borderRight = "none";
(Note that border-right
becomes borderRight
for JavaScript, and make sure you spell names exactly.)
However you might prefer user stylesheets. Browser extensions such as Stylish let you write CSS that is applied automatically, instead of going through script. (You can hide things using display: none
, or mute them with opacity: 0.5
.)