0

I am trying to get the class div class to javascript by using this.template.querySelector() but getting empty

Html 
    <template>
        <div class="validate">
            Class value 
        </div>
        {elementvalue}
    </template>
    Javascript

    export default class App extends LightningElement 
    {
        elementvalue;
        renderCallback() 
            {
                this.elementvalue=this.template.querySelector('.validate');
            }
    }      

1 Answer 1

0

It's renderedCallback, not renderCallback.

Demo.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .