Need help extracting the value of an element within the DOM. Specifically, I am interested in retrieving the "Active" value from the style attribute:
<span ng-class="{'megatable-filter-box-txt-selected' : filter.value.length > 0}" class="ng-binding megatable-filter-box-txt-selected" style="">Active</span>
When attempting to access it through the console, I used the following code:
element = $("[sf-name='stateFilter']")
document.defaultView.getComputedStyle(element)
An error was thrown:
Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. at <anonymous>:1:22
What mistake am I making? What is the correct method to retrieve this value?