You can add !important
to the end of your style, like this:
element {
overflow: hidden !important;
}
This is something you should not rely on normally, but in your case that’s the best option. Changing the value in Javascript strays from the best practice of separating markup, presentation, and behavior (html/css/javascript).