Adding event listener to the json Key

Hi All,

I am planning to build a JSON code editor. with some extra features. If some one click on key of json data then some event should trigger. But I am not getting any proper class or span with any class name. Is there any way to add span tag in “key” of JSON object?

image

image
In Above Image I need similar kind to span tag like “value” has to add event listener on it.

I want the code in below way
image

You don’t need to go through the DOM for this. Using something like posAtCoords to find the document position under the mouse, and then syntaxTree(state).resolve(pos) to find out the syntax node at that point, should work.