2

I want to get Element height from document, I am trying get it with const header = document.getElementsByClassName(myClass). But there some problems in conversion of Element to HTMLElement. Are there some ways for building HTMLElement from string or getting attributes like offsetHeight from HTMLCollection?

const myheader = document.getElementsByClassName(myClass);
console.info(myHeader[0].offsetHeight);
Kas Elvirov
  • 7,394
  • 4
  • 40
  • 62

1 Answers1

0

Yes you can use something like this to get offset height

document.getElementsByClassName('popup')[0].offsetHeight
Farveen Hassan
  • 408
  • 4
  • 12