How to access html element text in chrome devtools console -
i have page whole bunch of blackquote
tags. in dev console typing document.getelementsbytagname("blockquote")
giving me array.
but if document.getelementsbytagname("blockquote").innertext
document.getelementsbytagname("blockquote").innerhtml
document.getelementsbytagname("blockquote").textcontent
document.getelementsbytagname("blockquote").outertext
document.getelementsbytagname("blockquote").outerhtml
all return undefined
however if inspect elements of array document.getelementsbytagname("blockquote")
can see above properties in place.
how access @ least 1 of them (innertext
, outerhtlm
, innertext
, outerhtml
, textcontent
) ?
or if want access specific element can use index in array
for (var i=0; <document.getelementsbytagname("blockquote").length; i++ ){ var singleelement = document.getelementsbytagname("blockquote")[i]; console.log(singleelement.innerhtml); }
Comments
Post a Comment