I have a PDF that I ran through PDFtoHTML to create an HTML page I can manipulate. There are multiple headlines that I'd like to select based off of a single color, rgb(0, 129, 162), because that seems to be the only discernible way to differentiate the headings from the rest of the text. There is a style element applying color to all span and div elements in the head element that applies the color.
span.cls_022{font-family:Arial,serif;font-size:11.1px;color:rgb(0, 129, 162);font-weight:normal;font-style:normal:text-decoration: none}
The HTML looks something like this below:
<div style="left: 72.02px; top: 204.98px; position: absolute">
<div class="cls_022" style="left: 72.02px; top: 204.98px; position:absolute;">
<span class="cls_022">Text I'd like to select</span>
</div>
</div>
Now, I can select and return the style element of the that contains the span with
document.getElementsByClassName("cls_022")[0].style.cssText
And that will return the style within the tag.
Within the dev tools I can see that it has a color property of rgb(0, 129, 162) and that is what I want to use to SELECT AND RETURN THE VALUE OF THE CSS COLOR PROPERTY.
Any thoughts?
getComputedStyle(element).getPropertyValue('the_prop_to_check'), but what do you want to do with that value? Are you gonna parse all the elements on the page and check which one has this value? There must be a better way to handle it (like CSS selectors), but from your question, it's hard to tell.