My code:
document.querySelector(".myTabs .line")[0].style.left = '30%' ;
By i have error
undefined is not an object (evaluating 'document.querySelector(".myTabs .line")[0].style')
How i can change css style from controller?
document.querySelector
will return the first element match with type is Element
. You need to convert it to HTMLElement
. Try this:
let elm = <HTMLElement>document.querySelector(".myTabs .line");
elm.style.left = '30%'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With