0

code snippets here produce/render expected data and alert box shows [object HTMLDivElement] the div will not hide; same is true using "visibility", "hidden"

       <p>
           <input id="readGroups" type="button" value="Read Groups using GRAPH"/> 
           <input id="readWorkOrderUsers" type="button" value="View Your Work Orders"/> 
           </p>
        </div>
      </div>          
      <div class="${styles.container}" id="groupTableContainer"></div>
      <div class="${styles.container}" id="workOrderTableContainer"></div>
    </div>
  </div>`;

this.domElement.querySelector('#readWorkOrderUsers')
               .addEventListener('click',() => {
                var groupContainer : Element = this.domElement.querySelector('#groupTableContainer');
                alert(groupContainer);
                groupContainer.setAttribute("display","none");
                //this._readWorkOrders();
                });
0

This because display is not an attribute of the HTML element groupTableContainer.

Style is an attribute, therefor this should work:

groupContainer.setAttribute("style", "{display:none;}");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.