style.setProperty()を使えば、追加できる
今までは
obj.setAttribute('style','property');
と書いていたが
これだと、複数回実行すると上書きされてしまう。
で、
obj.style.setProperty()
ならok
例:No return. Example: styleObj.setProperty('color', 'red', 'important')
https://developer.mozilla.org/ja/docs/Web/API/CSSStyleDeclaration
js
this.topContainer.style.setProperty('width','100%'); this.topContainer.style.setProperty('height','10px');