With a given jQuery selector $('#my-id .my-class a')
stored as a variable jqElement
, how can I return the string representation of that selector?
In other words:
jqElement = $('#my-id .my-class a');
jqElement.someFunc(); // returns '#my-id .my-class a'
I looked here How do I get a jQuery selector's expression as text?, but found the information outdated and possibly incomplete.