How to select a node with id attribute?

I am trying to replace a node with some other node. But I don’t want to replace it using the position of the text. I have already assigned id attrs to the Node I want to replace. How do i select it?

You’re going to need to find its position You could scan the current document for a node with the ID you’re looking for to do that.

1 Like

I see, My only option is to find its position in the document.

As it happens I had a/the same kind of requirement last week. In my case - I’m using tiptap - a UniqueID extension helped. See: UniqueID – Tiptap Editor