将给定的jQuery选择器$('#my-id .my-class a')
存储为变量jqElement
,如何返回该选择器的字符串表示形式?检索jQuery选择器的字符串表示形式
换句话说:
jqElement = $('#my-id .my-class a');
jqElement.someFunc(); // returns '#my-id .my-class a'
我看了这里How do I get a jQuery selector's expression as text?,却发现该信息已过期,且可能不完整。
可能重复http://stackoverflow.com/questions/500246/how-do- I-GET-A-jQuery的选择表达,如文本) –