selector for first element with class notion-focusable, role button, tabindex 0 in javascript

To select the first element with class notion-focusable, role button, and tabindex value of 0, you can use the querySelector method with the following CSS selector:

index.tsx
const element = document.querySelector('.notion-focusable[role=button][tabindex="0"]:first-of-type');
102 chars
2 lines

This selector will target the first element that matches the specified class, role, and tabindex criteria. The [attribute=value] notation is used to target elements with a specific attribute value. The :first-of-type pseudo-class ensures that only the first matching element is selected.

Once you have selected the desired element, you can manipulate it as needed using DOM methods and properties.

gistlibby LogSnag