How to find particular dom element inside codemirror source code string

I am creating the live html editing. I can access the dom element on the html side using mouse event. I want to trace the element in the codemirror html string.