Implement a function getElementsByStyle(element, property, value) that searches through all descendants of a given DOM element and returns an array of elements whose computed style matches the specified property/value.
Requirements:
document.querySelectorAll.window.getComputedStyle useful.Example
const doc = new DOMParser().parseFromString( `<div> <span style="font-size: 12px">Span</span> <p style="font-size: 12px">Paragraph</p> <blockquote style="font-size: 14px">Blockquote</blockquote> </div>`, 'text/html' ); getElementsByStyle(doc.body, 'font-size', '12px'); // returns [span, p] (array of elements)
JavaScript Function
No test results yet
Click "Run" to execute tests