I have an html element that has a set style.
element.style {
"existing css;"
}
I want to add on to the style without overwriting the "existing css". (e.g my style is opacity and pointer-events)
element.style = "opacity: 0; pointer-events: none;"
Result I'm looking for:
element.style {
existing css;
opacity: 0;
pointer-events: none;
}
Current Output:
element.style {
opacity: 0;
pointer-events: none;
}
I know I can just add a class but want to know if theres a way to use javascripts element.style = "css". I have also tried:
element.style += "opacity: 0; pointer-events: none;
Any feedback will be greatly appreciated.