I added a click event to all elements on the page and now want to send the clicked target element to a server. If the clicked element has an ID, then I can just send the ID, but if the element doesn't have an ID, class, name, ... , then how can I send an identifier (or selector) to the server which points to this exact element?
I tried sending the jquery.target object itself. However, this results in a "Uncaught TypeError: Converting circular structure to JSON" error.
Is there a way to serialize a jquery object or to create a selector based on the current element?