Is there a way to add styles onto an html element without overwriting existing css?
element.style {
"existing css;"
}
I'm trying to achieve the following result:
element.style {
existing css;
opacity: 0;
pointer-events: none;
}
But currently, I am only getting:
element.style {
opacity: 0;
pointer-events: none;
}
Is there a method in JavaScript using element.style = "css" for achieving this without just adding a new class? I have attempted:
element.style += "opacity: 0; pointer-events: none;
Any insights or suggestions are welcome and appreciated.