Is there a function that gives the dom element to a Javascript function with Javascript and returns the Selector of that element in the relevant html as a string. Briefly, I want to do the process in the picture below without using Chrome dev tools. I looked inside the nodes but couldn't find a breakdown that gives the selector