User-719153870 posted
Hi ahmedbarbary,
error TS2339: Property 'rows' does not exist on type 'HTMLElement'.
Typescript is typesafe which means the var table = document.getElementById("CompareParts");
returns the type HTMLElement
which does not contain a rows
property.
You have to cast the result of getElementById()
to
HTMLTableElement
(most likely HTMLTableElement
, not tested, if this can not work, please try cast to other type element.) like below:
var table = (<HTMLTableElement >document.getElementById("CompareParts"));
For this solution, you can refer to The property 'value' does not exist on value of type 'HTMLElement'.
As for the HTMLTableElement, you can check this
doc and other type elememts can be found on the left side of this doc "Related pages for HTML DOM".
Best Regard,
Yang Shen