← Back to CSS domain
CSS.getLocationForSelector
Given a CSS selector text and a style sheet ID, getLocationForSelector
returns an array of locations of the CSS selector in the style sheet.
Domain: CSS
experimental
Parameters
| Name | Type | Description |
styleSheetId | DOM.StyleSheetId | |
selectorText | string | |
Returns
| Name | Type | Description |
ranges | array | |
Example Request
{
"id": 1,
"method": "CSS.getLocationForSelector",
"params": {
"styleSheetId": "styleSheetId-value",
"selectorText": "selectorText-value"
}
}
Example Response
{
"id": 1,
"result": {
"ranges": []
}
}
Usage in Node.js
const result = await send('CSS.getLocationForSelector', {"styleSheetId": "styleSheetId-value", "selectorText": "selectorText-value"});
console.log(result);
// {"ranges": []}