javascript - getElementById is not a function on an HTMLElement -
this question has answer here:
i trying parse data using javascript dom.
for debugging have been using var prod = prodheader.parentelement.innerhtml;
.
this results in:
<img src="/content/images/pdf.png" style="width:30px;height:30px;" onclick="getpdf(this);"><label id="currentpd" style="display:none">pd-14-0012</label><label id="currentpl" style="display:none">1</label>
which good. want data of label currentpd
. i’ve been trying doing:
var prod = prodheader.parentelement.getelementbyid("currentpd").innertext;
but unfortunately, gives me error:
prodheader.parentelement.getelementbyid not function
@kevin b
as can see, method. give me currentpd of first row, , not currentpd of row clicked img. relevant row ;)
Comments
Post a Comment