getting width of an element in JS not getting expected result for width

$(parentelement).find(".spec-table__thead.spec-table__thead--original th p").each((function(index, element) {
  console.log($(element))
  console.log($(element)[0].clientWidth)
  i.push($(element)[0].clientWidth)
}));

I have the code above and the console returns:

enter image description here

But upon checking the inside of the $(element)

I can see :

className: ""
clientHeight: 47
clientLeft: 0
clientTop: 0
clientWidth: 585
contentEditable: "inherit"

meaning value that I should be getting is 585 but why do I get 696

FYI: using the first entry as sample.



from Recent Questions - Stack Overflow https://ift.tt/2Y0pMsA
https://ift.tt/2Nx9qp5

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations