{
  "id": 6023960,
  "title": "A New Challenger to CSS Selectors: WebForms Place Criteria (WPC)",
  "url": "https://urgent.news/2026/09/06/a-new-challenger-to-css-selectors-webforms-place-criteria-wpc",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-06T19:51:31.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/elanatframework/a-new-challenger-to-css-selectors-webforms-place-criteria-wpc-joc"
  },
  "original_language": "en",
  "account": "WebForms Core 2.1 has introduced significant enhancements to the WebForms Place Criteria (WPC) system. WPC is a domain-specific language embedded within WebForms Core that enables the selection, filtering, and manipulation of HTML elements and their relationships within the Document Object Model (DOM). At its core, WPC offers a range of selectors for identifying elements based on ID, Name, Tag, Class, and Attribute attributes, as well as navigating through various DOM elements such as children, parents, the current element, and higher-level elements like Document, Window, HTML, Head, Root, and more. Furthermore, elements can be selected by their index, all matching elements can be retrieved, and selection paths can be combined using functions like Child() and Parent(). The functionality of WPC is built to complement CSS Selectors, while also extending their capabilities.\n\nWPC's primary function is to locate HTML elements (and beyond) that are targeted for modification. Unlike CSS Selectors, WPC provides a more comprehensive selection mechanism that includes the ability to filter and evaluate already-selected elements based on diverse criteria. This Criteria layer of WPC goes beyond basic selection techniques (like ID, Class, Tag) by enabling developers to filter and assess selected elements through various attributes, text content, tag names, visibility, enabled or disabled state, checked state, DOM relationships, position, ranges, and sets of elements. The article focuses specifically on the Criteria layer of WPC and illustrates how it can be utilized to refine element selections, evaluate their properties and state, navigate their relationships, and combine multiple conditions to produce precise DOM selections that extend far beyond the simple examples of selecting elements by ID or class.\n\nThe article provides several examples demonstrating the capabilities of WPC:\n\n1. Filtering by Text and Numeric Value: This example selects all 'td' elements and filters them based on their text content. For instance, elements with text content greater than or equal to 10 are set to green (e.g., 17, 11, 15, 20), while those with text content less than 10 are set to red (e.g., 6, 5, 9). This showcases WPC's ability to perform numeric comparisons on the text content of elements.\n\n2. Combining Criteria with Different Operators: This example changes the font size of elements whose text content is greater than 10. The condition '!t :10' uses the '!' operator to reverse the comparison, selecting elements whose text content is not less than or equal to 10, effectively selecting elements with text content greater than 10. Another example selects 'td' elements whose text content is exactly 20.\n\n3. Searching for Text Inside Elements: WPC can search for specific text within elements. For example, it can add text 'Find: Adriano' to any element containing the word 'Adriano'. This demonstrates WPC's capability to perform textual searches within elements.\n\n4. Selecting Elements by Attribute: WPC can select elements based on an attribute and its value. For instance, it can select input elements where the attribute 'att1' ends with '9', selecting elements with attribute values such as '123456789', '119', and '59'.\n\n5. Selecting Elements by Tag Name: This example demonstrates selecting all 'input' elements in a form and applying a yellow border to them. It shows WPC's ability to select elements based on their tag names.\n\n6. Checking Visibility: The article shows how WPC can select elements that are not visible. Using the '?!v' condition, it selects elements that have 'display:none' applied, effectively finding elements that are hidden from view.\n\n7. Finding Disabled Elements: This example identifies disabled input elements by applying the '!v' condition, which selects elements that are not in the visible state. This highlights WPC's utility in targeting elements based on their enabled or disabled state.\n\nThese examples showcase the versatility and power of WPC, demonstrating its potential to go far beyond simple element selection through ID or class. WPC provides a comprehensive and flexible system for manipulating and refining selections within the DOM, making it a valuable tool for developers working within the WebForms framework.",
  "summary": "One of the major improvements in WebForms Core 2.1 is the expansion of WebForms Place Criteria (WPC) . WPC is a DSL built into WebForms Core for selecting, filtering, and manipulating HTML elements and groups of DOM elements. At its basic level, WPC provides selectors for finding elements by ID, Name, Tag, Class, and Attribute , as well as navigating through children, parents, the current…",
  "key_points": [
    "WebForms Core 2.1 introduces WebForms Place Criteria (WPC) system enhancements",
    "WPC offers advanced selectors for DOM element selection, filtering, and manipulation",
    "WPC complements CSS Selectors with additional criteria for element selection"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}