diff --git a/README.md b/README.md index 278232b..8c1a75f 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ A comprehensive collection of coding challenges from multiple platforms for lear | Platform | Focus Area | Problems Solved | | ------------------------------- | ---------------------------- | --------------- | | [LeetCode](#leetcode) | Data Structures & Algorithms | 171 | -| [GreatFrontEnd](#greatfrontend) | Frontend Engineering | 12 | +| [GreatFrontEnd](#greatfrontend) | Frontend Engineering | 13 | ## Platforms diff --git a/greatfrontend/gfe-75/README.md b/greatfrontend/gfe-75/README.md index ac7d96e..7c8443f 100644 --- a/greatfrontend/gfe-75/README.md +++ b/greatfrontend/gfe-75/README.md @@ -4,7 +4,7 @@ The GFE 75 is GreatFrontEnd's curated collection of 75 essential frontend coding ## 📊 Progress Tracker -### Status: 6 / 75 problems completed +### Status: 7 / 75 problems completed ## ✅ Completed Problems @@ -18,7 +18,7 @@ The GFE 75 is GreatFrontEnd's curated collection of 75 essential frontend coding ### DOM Manipulation -No problems completed yet +- [getElementsByStyle](./dom-manipulation/getElementsByStyle/) - Medium ### Async Programming diff --git a/greatfrontend/gfe-75/dom-manipulation/getElementsByStyle/README.md b/greatfrontend/gfe-75/dom-manipulation/getElementsByStyle/README.md new file mode 100644 index 0000000..34d55b0 --- /dev/null +++ b/greatfrontend/gfe-75/dom-manipulation/getElementsByStyle/README.md @@ -0,0 +1,23 @@ +# getElementsByStyle + +Implement a method `getElementsByStyle()` that finds DOM elements that are rendered by the browser using the specified style. It is similar to `Element.getElementsByClassName()` but with some differences: + +- It is a pure function which takes in an element, a property string, and a value string representing the style's property/value pair to be matched on the elements descendants. E.g. `getElementsByStyle(document.body, 'font-size', '12px')`. +- Similar to `Element.getElementsByClassName()`, only descendants of the element argument are searched, not the element itself. +- Return an array of `Elements`, instead of an `HTMLCollection` of `Elements`. + +## Examples + +```javascript +const doc = new DOMParser().parseFromString( + `
Paragraph
+Blockquote+